1、NSString *docDir = paths objectAtIndex0 if atomicallyyesno的区别!docDir NSLog@”Documents directory not found!” return NO NSString *filePath = docDir stringByAppendingPathComponentfileNamereturn data writeToFilefilePath atomicallyYES 2atomicallyyesno的区别,从Documents目录读取数据 NSData;iOS 各种控件默认高度 用户可以隐藏状态栏,也可以将状态栏设置为灰色,黑色或者半透明的黑色如果需要隐藏状态栏可以使用调用UIApplication sharedApplication setStatusBarHiddenYES animatedNO或者在应用程序文件Infoplist中将UIStatusBarHidden键设为ture2导航栏 在纵向模式下导航栏为44像素高。
2、首先你的数据存在一个字典里面也就是NSDictionary里,有一个方法为writeToFileatomicallydictwriteToFile@quotyourpathxxxplistquotatomicallyYES读取出来就这样dict=NSdictionarydictionaryWithContentsOfFile@quotyourpathquot。
3、BOOL value = array writeToFileplistPath atomicallyYES if value NSMutableArray *newArray = NSMutableArray arrayWithContentsOfFileplistPath NSLog@quotnew array = %@quot,newArray * 输出 new array = 0, 1, 2, 3 *获取沙箱中document的path NSArray *paths = NS;NO, 00CGContextRef context = UIGraphicsGetCurrentContextif selfimageView respondsToSelector@selectordrawViewHierarchyInRectafterScreenUpdates if iOS 7, just draw it selfimageView drawViewHierarchyInRect afterScreenUpdatesYES else;responsesInfo writeToFilepath atomically YES 这里我用atomicallyyesno的区别了stringByAppendingString方法,更保险的是使用stringByAppendingPathComponent不过我估计后者会做更多的检查工作,所以采用了前者在实现saveInfo后,初始化方法就也可以实现了它主要就是载入保存的plist文件,如果不存在则新建一个空的NSMutable。
4、感觉数据库没有正确连接,你确认所以参数都对吗没有漏掉哪个比如端口def Connectself, *args, **kwargsselfconn = MySQLdbconnect*args, **kwargsself_cursor = 在这里先打印这两个对象看一下,看有没有正确创建。
还没有评论,来说两句吧...