2011-04-18 23 views
0

我正在開發一個將餐廳信息發佈到用戶Facebook牆上的應用程序。一切工作正常,除了我不知道如何在JSON代碼的「description」部分插入新行。我的相關代碼如下:在iPhone上發佈到Facebook時使用JSON中的新換行序列

FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease]; 
dialog.userMessagePrompt = @"Enter your message:"; 
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Check out this great restaurant!\",\"href\":\"/\",\"caption\":\"%@\",\"description\":\"%@ /*NEW LINE HERE*/%@, %@ /*NEW LINE HERE*/%@\",\"media\":[{\"type\":\"image\",\"src\":\"http://www.myhost.ca/images/image_IC_B_03.png\",\"href\":\"http://www.myhost.com/\"}]}", 
        restaurantObj.name, restaurantObj.address, restaurantObj.city, restaurantObj.provinceState, restaurantObj.phoneNumber]; 
dialog.actionLinks = @"[{\"text\":\"Download this app!\",\"href\":\"http://www.myhost.com/\"}]"; 

[dialog show]; 

我試圖插入\ n和我試圖插入\ r在不工作的地方我上面標明,但不幸的是。有沒有人有解決這個問題?

回答

相關問題