2、打印格式

符号 格式
%@ 对象
%zd NSInteger
%lx CFIndex
%tu NSUInteger
%i int
%u unsinged int
%hu unsigned short
%% %符号
%p 指针
%02ld 打印两位数整形,不足前面补零
%s,PRETTY_FUNCTION或__FUNCTION__ 打印方法名
%f 浮点、双字
%04X 四位十六进制

-原文链接-

4、iOS监听通话状态

监听通话状态

#import <CoreTelephony/CTCallCenter.h>
#import <CoreTelephony/CTCall.h>

self.callCenter = [[CTCallCenteralloc] init];
        WEAKSELF;
        self.callCenter.callEventHandler = ^(CTCall* call) {
            NSLog(@"callid %@",call.callID);
            if ([call.callState isEqualToString:CTCallStateDisconnected])
            {
                NSLog(@"挂断了电话咯Call has been disconnected");
                if(weakSelf.isTrueCall && weakSelf.currentContactPhoneOrder && weakSelf.isContactSuccess){
                    [weakSelf notificationServicePhoneState];
                }else{
                    weakSelf.isTrueCall = NO;
                    weakSelf.isContactSuccess = NO;
                }
            }
            else if ([call.callState isEqualToString:CTCallStateConnected])
            {
                NSLog(@"电话通了Call has just been connected");
                if (weakSelf.isTrueCall) {
                    weakSelf.isContactSuccess = YES;
                }
            }
            else if([call.callState isEqualToString:CTCallStateIncoming])
            {
                NSLog(@"来电话了Call is incoming");

            }
            else if ([call.callState isEqualToString:CTCallStateDialing])
            {
                NSLog(@"正在播出电话call is dialing");
                weakSelf.isTrueCall = YES;
            }
            else
            {
                NSLog(@"嘛都没做Nothing is done");
            }
        };

-原文链接-