Alamofire.request(.POST, endpoint, parameters: params)
.responseJSON { request, response, result in
switch result {
case .Success(let json):
var customerData:[String:AnyObject] = [String:AnyObject]()
// throws: Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
如果我在请求之外声明var并尝试设置customerData["whatever"] = "some value"
答案 0 :(得分:-1)
请检查此代码。
$(document).ready(function(){
$('#wayfindermenu a').click(function(e){
hideContentDivs();
var tmp_div = $(this).parent().index();
$('.maincontent div').eq(tmp_div).show();
});
function hideContentDivs(){
$('.maincontent div').each(function(){
$(this).hide();});
}
hideContentDivs();
});
var selector = '#wayfindermenu li';
$(selector).on('click', function(){
$(selector).removeClass('active');
$(this).addClass('active');
});
它在Playground xcode 7.1 beta中运行良好