好了,我已经被告知这是一个可怕的想法耽误我的代码NSString的值更改后 - (ID)初始
-(id)init
一部分,但不幸的是它是字符串之前NSLogging NULL值有时间注册变更。
这里是我的ID初始化
- (id)init {
if (self = [super init]) {
CFStringRef aCFString = (CFStringRef)[appDelegate baseURL];
CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), aCFString, NULL, NULL);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
NSLog(@"xSheetMusicViewController - %@",appDelegate.baseURL);
CFRelease(pdfURL);
}
return self;
}
,这里是控制台输出代码:
2011-09-18 09:52:22.275 SheetMuse[57499:b603] value - (null)
failed to find PDF header: `%PDF' not found.
2011-09-18 09:52:24.575 SheetMuse[57499:b603] xSheetMusicViewController - (null)
2011-09-18 09:52:24.581 SheetMuse[57499:b603] Application tried to push a nil view controller on target <UINavigationController: 0x4e5a910>.
2011-09-18 09:52:24.624 SheetMuse[57499:b603] value - mussette.pdf
2011-09-18 09:52:24.627 SheetMuse[57499:b603] Application tried to push a nil view controller on target <UINavigationController: 0x4cc1ba0>.
2011-09-18 09:52:24.628 SheetMuse[57499:b603] value - mussette.pdf
原来的NULL值是由应用程序启动的时候它应该是空(毕竟,为什么我会在启动时需要该字符串?),但它提到它“未能找到PDF头”,这对我来说是非常新的。那么xSheetMusicViewController会尝试获取字符串值,但它在启动时仍然为空。 (ID),init方法或找一个更快的方法来更新初始化前的字符串的值 - 然后将值从
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
方法,这意味着,不知何故,我要么不得不推迟更新。
任何人都可以帮忙吗?
为什么又要问同样的问题?在您的上一个问题中存在一个适合您问题的答案:http://stackoverflow.com/questions/7459339/delaying-an-idinit-instance-is-it-possible – thomas
它不适合。 Davyd爵士认为我使用的是服务器。虽然我喜欢插入一个异步调度,并将其作为正确的下雨,但我不能。所有文件都是本地的。 – CodaFi