ภายใน AppDelegate.m ฉันกำลังพยายามดึงข้อมูลจากสตริงที่ฉันได้รับจาก URL ที่เข้ามา ฉันไม่แน่ใจว่าทำไม NSLog จึงไม่พิมพ์อะไรเลย...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions openURL:(NSURL *)url
{
// incoming URL...
// i.e. palsvid://blabla.com/foo.php?request=laa&id=1004
NSString *q = [url query];
NSLog(@"%@",q); // Does not log anything! Even with a hard coded string!
NSArray *pairs = [q componentsSeparatedByString:@"&"];
// ...
ฉันทำอะไรผิดหรือเปล่า? ฉันอัปเดต plist เพื่อยอมรับ URL ตอนนี้ฉันต้องการแยกวิเคราะห์
ในที่สุด ฉันจะนำข้อมูลนี้ไปใช้ใน ViewController ของฉัน NSLog ทำงานในวิธี ViewController...
ขอบคุณ