小编Bla*_*zer的帖子

保护开关的情况

可能重复:
将项目转换为使用ARC时,"switch case是否在受保护的范围内"是什么意思?

得到以下xcode:但是当我尝试在案例1(或空)中放置一些东西时,它给了我一个错误?

奇怪的问题,因为我不知道受保护的交换机是什么以及我应该如何解决它.有没有人有解决方案或线索来解决这个问题?奇怪的..

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIViewController *controller;

    switch(indexPath.row) {
        case 0:
            NSLog(@"0");

            //create instance of EKEventStore
            EKEventStore *eventStore = [[EKEventStore alloc] init];

            //creating instance of EKEvent
            EKEvent *event  = [EKEvent eventWithEventStore:eventStore];

            //setting the appropriate properties of the new event
            event.title     = @"Woow";

            //event.startDate = [[NSDate alloc] init];



            NSDateComponents *myDate2 = [[NSDateComponents alloc] init];
            [myDate2 setDay:13];
            [myDate2 setMonth:12];
            [myDate2 setYear:2011];
            [myDate2 setHour:00];
            [myDate2 setMinute:34];

            event.startDate = [[NSCalendar currentCalendar] dateFromComponents:myDate2];

            event.endDate   = [[NSDate alloc] initWithTimeInterval:3600 sinceDate:event.startDate]; …
Run Code Online (Sandbox Code Playgroud)

objective-c switch-statement

83
推荐指数
2
解决办法
4万
查看次数

仅在iOS中首次启动时显示屏幕

Tweetbot和Clear show在应用程序的第一次启动时,一个小教程屏幕应用程序如何工作.带有小教程的屏幕仅在应用程序首次启动时弹出(1次)

如何以及我能做出类似的事情?任何人都可以把我推向正确的方向吗?

查看我的意思是:

在此输入图像描述

cocoa-touch objective-c ios

29
推荐指数
3
解决办法
3万
查看次数

无效的PNG图像文件:iDOT未指向有效的IDAT块

我在应用程序中有一些HTML内容页面,我正在使用UIWebView来显示它们.其中一些页面中有一个PNG图像,它在xcode的调试控制台中生成以下消息:

ImageIO: PNG invalid PNG file: iDOT doesn't point to valid IDAT chunk
Run Code Online (Sandbox Code Playgroud)

图像仍然显示并且看起来正确.这也只有在我在iPad(第3代)上运行应用程序时才会发生.我的iPhone 4不显示此消息.

我的第一个想法是它是由文件名中的〜字符引起的(我已经将~ipad标签添加到文件名中).但是,删除〜字符没有任何影响.

我做了谷歌搜索,但我只得到了3个结果.其中2个是中文,谷歌的翻译似乎没有很好的翻译.其他结果似乎是与我有同样问题的人,但没有回复他的帖子.

html png objective-c ipad javax.imageio

12
推荐指数
2
解决办法
1万
查看次数

PerformSelector警告

我收到了警告

PerformSelector可能导致泄漏,因为其选择器未知

在代码中:

- (void) callDelegate: (SEL) selector withArg: (id) arg error: (NSError*) err
{
    assert([NSThread isMainThread]);
    if([delegate respondsToSelector: selector])
    {
        if(arg != NULL)
        {
            //this line the warning
            [delegate performSelector: selector 
                           withObject: arg 
                           withObject: err]; 
        }
        else
        {
            //this line the warning
            [delegate performSelector: selector 
                           withObject: err]; 
        }
    }
    else
    {
        NSLog(@"Missed Method");
    }
}
Run Code Online (Sandbox Code Playgroud)

标题:

@interface Topscore : UIViewController <NSObject> {

//
}
Run Code Online (Sandbox Code Playgroud)

objective-c compiler-warnings ios performselector

10
推荐指数
2
解决办法
1万
查看次数

使用IBAction从我的应用程序中打开本机Twitter应用程序

我想将natvie Twitter应用程序实现到我的iOS应用程序中.我已经通过使用URL Schemes在Facebook上完成了这项工作.但我无法为Twitter找到这样的东西.

对于Facebook,我用过:

-(IBAction)facebook:(id)sender {
       [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://"]];
}
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用时

@"Twitter" or @"twitter" or @"tw"
Run Code Online (Sandbox Code Playgroud)

什么都没发生.如果你们能帮助我,那会很棒.我没有在Interweb中找到任何东西:/如果有类似的东西请:)

提前致谢 :)

twitter xcode objective-c url-scheme ibaction

4
推荐指数
1
解决办法
4782
查看次数

initWithStyle :( UITableViewCellStyle)未调用

发生了一件奇怪的事情,我试图构建我的自定义tablecell,但我的initWithStyle没有被调用.

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
Run Code Online (Sandbox Code Playgroud)

我的Tablecell看起来很正常:

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        NSLog(@"xx1111");
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
Run Code Online (Sandbox Code Playgroud)

我是如何尝试加载Customcell笔尖的:

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

    static NSString *TFDCustomCell = @"TFDCell";
    TFDCell *cell = (TFDCell *)[tableView dequeueReusableCellWithIdentifier:TFDCustomCell];

    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TFDCell"
                                                     owner:self options:nil];
        for (id oneObject in nib) …
Run Code Online (Sandbox Code Playgroud)

objective-c ios

3
推荐指数
2
解决办法
3826
查看次数