小编Han*_*One的帖子

iOS 7错误或我在UIAlertView中的错误

当我的应用程序在UIAlertView上点击"确定"时崩溃时,我有以下堆栈跟踪.这是我的错还是iOS7错误?我不知道如何解决这个问题.

OS Version:          iOS 7.0 (11A465)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000000
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x39d50b36 objc_msgSend + 22
1   UIKit                           0x3212e3da -[UIAlertView(Private) modalItem:shouldDismissForButtonAtIndex:] + 58
2   UIKit                           0x31ed2036 -[_UIModalItemsCoordinator _notifyDelegateModalItem:tappedButtonAtIndex:] + 90
3   UIKit                           0x31ed1f3e -[_UIModalItemAlertContentView tableView:didSelectRowAtIndexPath:] + 890
4   UIKit                           0x31dd7326 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1074
5   UIKit                           0x31e8a24e -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 210
6   UIKit                           0x31d3a96e _applyBlockToCFArrayCopiedToStack + 314
7   UIKit …
Run Code Online (Sandbox Code Playgroud)

objective-c uialertview ios7

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

UIWebView:不会调用Delegate

我尝试使用给定内容计算UIWebView的大小,但不显示视图.我只需要知道尺寸.

我的问题:当我执行代码时,不会调用UIWebView的委托.为什么?

MessageSizeCaluclator.h

#import < Foundation/Foundation.h>

@class Message;

@interface MessageSizeCaluclator : NSObject <UIWebViewDelegate>

- (id)initWithMessage:(Message*)message;
- (void)saveSize;

@end
Run Code Online (Sandbox Code Playgroud)

MessageSizeCaluclator.m

#import "Message.h"
#import "MessageSizeCaluclator.h"


@interface MessageSizeCaluclator () <UIWebViewDelegate>

@property (strong, nonatomic) Message* message;
@property (strong, nonatomic) UIWebView* webView;

@end


@implementation MessageSizeCaluclator

@synthesize message = _message;
@synthesize webView = _webView;


- (id)initWithMessage:(Message*)message
{
self = [super init];

if (self) {
    _message = message;

    // WebView
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
    _webView.delegate = self;
}

return self;
}

- (void)saveSize …
Run Code Online (Sandbox Code Playgroud)

objective-c

5
推荐指数
1
解决办法
437
查看次数

如何实现UITableViewCell的摇动动画

如何让UITableViewCell从左侧向右侧摇晃?

我希望用户知道"这个动作是不可能的"!

animation uitableview shake caanimation ios

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