这是代码:
#import <Foundation/Foundation.h>
#import "microsoft.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
int a,b,sum,mul1,mul2;
microsoft *m1=[microsoft alloc];
NSLog(@"\nEnter first variable : ");
scanf("%d",&a);
NSLog(@"\nEnter first variable : ");
scanf("%d",&b);
[m1 sumvar1:a var2:b];
sum=[m1 getsum];
mul1=[m1 mulvar1:3 var2:3]; // Error Line -----
mul2=[m1 getmul];
[m1 name:@"hello"];
NSLog(@"\nName : %@ \n Sum = %d \n Mul = %d",[m1 name],sum,mul1);
}
return 0;
}
调试导航器 - 线程 1
libdyld.dylib`start:
0x7fff91f6d7e1: movl %eax, %edi
0x7fff91f6d7e3: callq 0x7fff91f6d808 ; symbol stub for: exit
0x7fff91f6d7e8: hlt
调试导航器 - 线程 2
libsystem_kernel.dylib`kevent:
0x7fff9427ad0c: movl $33554795, %eax
0x7fff9427ad11: movq %rcx, %r10
0x7fff9427ad14: syscall
0x7fff9427ad16: jae 0x7fff9427ad1d ; kevent + 17
0x7fff9427ad18: jmpq 0x7fff9427b4d4 ; cerror_nocancel
0x7fff9427ad1d: ret
0x7fff9427ad1e: nop
0x7fff9427ad1f: nop
为什么这个语句mul1=[m1 mulvar1:3 var2:3]
会导致崩溃?