IOS 开发遇到的问题

1.whose view is not in the window hierarchy


Where are you calling this method from? I had an issue where I was attempting to present a modal view controller within the viewDidLoad method. The solution for me was to move this call to the viewDidAppear: method.

My presumption is that the view controller's view is not in the window hierarchy at the point that it has been loaded (when the viewDidLoad message is sent), but it is in the window hierarchy after it has been presented (when the viewDidAppear: message is sent).



2.TableView

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView  //表示一共有多少段,所谓段就好比通讯录中A-Z这么来区分用户组,这个段就是一个字母. 你希望你的TABLE有多少个HEADER就有多少个 section


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

//每个section有多少行,比如你通讯录中以A开头的联系人有2个,就是2


- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

//每一段的头部的样式,自己定义,加个图片,价格LABEL都行


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{

//每一段头部的高度


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

//每一段中的每一行的高度


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

//每一段中的每一行的样式,可以自己定义

// indexPath.section 来确定是哪个段, indexPath.row来确定哪个行



3.Receiver 'NSManagedObjectContext' for class message is a forward declaration


来自stackoverflow的解答:

You must import CoreData/CoreData.h in the file Supporting Files/YourApp-Prefix.pch:

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import <CoreData/CoreData.h>
#endif


4.使用SDWebImage和MKNetworkKit要注意

 使用SDWebImage一定要在项目的Build Phases的Link Binary With Libraries里面加入MapKit.framework
使用MKNetWorkKit要加入CFNetwork.framework



5.'libxml/tree.h' file not found

Build Settings中的Search Path中的Header Search Paths 该为     ${SDKROOT}/usr/include/libxml2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值