您的位置:首页 > 移动开发 > IOS开发

IOS 开发遇到的问题

2014-05-07 15:08 204 查看


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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: