練習(xí)項目,遇到所有問題都在這記錄。
一、請求參數(shù)count
需要使用NSString
類型
1、開發(fā)中,接口文檔有個參數(shù)是
count
,類型是?int
,我就自然的寫了句如下代碼
@interface LBBBaseStationParam : NSObject
/** 經(jīng)度 */
@property (nonatomic, assign) double lng;
/** 緯度 **/
@property (nonatomic, assign) double lat;
/** 第幾頁,可為空,默認第一頁 */
@property (nonatomic, assign) NSInteger page_num;
/** 每頁幾條,可為空,默認20條 */
@property (nonatomic, assign) NSInteger count;
@end
- 然而并沒有請求數(shù)據(jù)
- 當(dāng)天晚上沒有解決,也就睡了,第二天晚上,才懷疑起是不是參數(shù)問題(比較笨)。
2、修改了如下代碼
@interface LBBBaseStationParam : NSObject
/** 經(jīng)度 */
@property (nonatomic, assign) double lng;
/** 緯度 **/
@property (nonatomic, assign) double lat;
/** 第幾頁,可為空,默認第一頁 */
@property (nonatomic, assign) NSInteger page_num;
/** 每頁幾條,可為空,默認20條 */
@property (nonatomic, strong) NSString *count;
2、-[__NSDictionaryM objectAtIndexedSubscript:]: unrecognized selector sent to instance
打開
All Exception
報錯在這:
Snip20160110_4.png
- 1、po 打印
self.infomations
,并發(fā)現(xiàn)如下錯誤:
Snip20160110_5.png - 2、尼瑪,趕緊檢查了初始化有沒有錯誤,并看了聲明,發(fā)現(xiàn)了聲明竟然用了
assgin
,Fuck Me
:
Snip20160110_6.png - 3、尼瑪,嚇的我,趕緊改回了
strong
, --。
3、關(guān)于ShareSDK
集成的錯誤
a、Error Domain = shareSDKErrorDomain Code=202"(null)" Userinfo={error_message=分享[微信]}尚未導(dǎo)入WXApi.a庫!無法進行分享!}
1.png
- 解決方法:如圖: onImport不為nil,官網(wǎng)文檔:http://wiki.mob.com/ios簡潔版快速集成/
Snip20160125_1.png
b、Error Domain=ShareSDKErrorDomain Code=207"(null)" UserInfo={error_message=尚未設(shè)置分享平臺[微信]的URL Scheme: xxxxxxxxx,無法進行分享!請在項目設(shè)置中設(shè)置URL Scheme后再試}
2.png
解決辦法 :要在如圖中加入URL Schemes。官方文檔:http://wiki.mob.com/ios簡潔版快速集成/
Snip20160125_2.png
c、分享頁面顯示英文
如圖:
1.png
解決方法:如圖需要加入中文簡體
Snip20160125_5.png
d、去掉微信收藏
解決方法:http://wiki.mob.com/簡潔版更新說明-2/ 中的第4步
4、AFNetworking報錯
- a、
Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.
5、warning: no rule to process file
刪除對應(yīng)的文件即可。
Snip20160318_1.png
6、directory not found for option
第一步:
Snip20160318_2.png
第二步:
Snip20160318_3.png
7、error:Error Domain=NSURLErrorDomain Code=-1000 "錯誤的 URL" UserInfo={NSUnderlyingError=0x7fee92d0fc30 {Error Domain=kCFErrorDomainCFNetwork Code=-1000 "(null)"}
8、This bundle is invalid. The icon file xxx.app/LaunchImage-xxx@xx.png must be in .png format.
- 1、由于要縮小包的體積大小,就讓設(shè)計給了我
jpg
的圖片,然后我直接修改了后綴名png
,這樣直接放進包里面,打包的時候出現(xiàn)這個錯誤,解決辦法就是:jpg
不能直接修改為png
,需要用軟件轉(zhuǎn)換成png
。
9、Constant is not finite! That's illegal
1.png
出錯原因:除數(shù)可能為0,或者null。圖中紅框中的值為0的原因,是因為沒有這張
water_flow_footer_tip
圖片1.png