{"id":1222,"date":"2012-01-27T21:22:18","date_gmt":"2012-01-28T04:22:18","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=1222"},"modified":"2014-01-28T11:11:14","modified_gmt":"2014-01-28T18:11:14","slug":"ios-development-tips","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2012\/01\/27\/ios-development-tips\/","title":{"rendered":"iOS development tips"},"content":{"rendered":"
I have to write down all tips to save time in the future, some may look like naive but thinking of I’m such a newbie in iOS development, nothing was easy to me.<\/p>\n
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);\r\n NSString *registryFile = [[paths objectAtIndex:0] stringByAppendingPathComponent:@\"registry.file\"];<\/pre>\n<\/li>\n
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];\r\n [dict setValue:[textfield1 text] forKey:@\"key1\"];\r\n [dict setValue:[textfield2 text] forKey:@\"key2\"];\r\n\r\n [dict writeToFile:[self registryFileName] atomically:YES];<\/pre>\n
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithContentsOfFile:[self registryFileName]]<\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n