小编RAG*_*poR的帖子

如何解决malloc_error_break?

我在使用iOS 3.0模拟器时遇到此错误,但在3.1.3和3.2模拟器上却没有.

在创建符号断点后malloc_error_break,我在日志中看到了这一点:

[Session started at 2010-02-13 19:15:22 +0700.]
2010-02-13 19:15:24.405 iPortals[21656:207] bool for 1
iPortals(21656,0xa0089500) malloc: *** error for object 0x285e000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
iPortals(21656,0xa0089500) malloc: *** error for object 0x2850000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
iPortals(21656,0xa0089500) malloc: *** error for object 0x286c000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug …
Run Code Online (Sandbox Code Playgroud)

malloc objective-c ios

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

是否可以在UILabel中设置多种颜色?

从Jason Coco引用它不可能在UILabel中设置多个......但是

这样怎么办?

任何的想法?

替代文字

是否可以在UILabel中设置混合颜色

例如"TEST"我可以将E设置为红色而将另一个设置为白色吗?

iphone uilabel

5
推荐指数
3
解决办法
7408
查看次数

如何为armv7s构建Facebook iOS sdk?

有可能构建facebook ios sdk来支持armv7s(Apple A6 cpu)吗?我已经尝试使用build_framework.sh再次重建,它仍然不支持armv7s!

xcode facebook ios

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

在Sharekit for iPhone中设置Twitter

我尝试通过sharekit将twitter集成到iphone app我已将我的应用程序注册到twitter.我不明白如何设置回调URL你能告诉我更多信息和步骤部署吗?

iphone twitter

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

是否可以使用动画隐藏UIToolbar?

我知道此代码仅适用于此UINavigationController.

[self.navigationController setNavigationBarHidden:YES animated:YES];
Run Code Online (Sandbox Code Playgroud)

uitoolbar iphone-sdk-3.0

3
推荐指数
1
解决办法
4327
查看次数

隐藏和取消隐藏工具栏时按钮项目丢失

我不知道,为什么按钮在工具栏设置为隐藏和取消隐藏后消失.我该怎么办呢?

设置按钮代码

-(void)viewDidAppear:(BOOL)animated {
    //NSLog(@"viewDidAppear ");

    [self becomeFirstResponder];
    //Create a button
    UIBarButtonItem *back = [[UIBarButtonItem alloc] 
                        initWithBarButtonSystemItem:UIBarButtonSystemItemRewind 
                target:self action:@selector(goback:)];

    UIBarButtonItem *fixspace1 = [[UIBarButtonItem alloc] 
                                 initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace 
                                 target:self action:nil];

    UIBarButtonItem *next = [[UIBarButtonItem alloc] 
                             initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward 
                             target:self action:@selector(gofwd:)];
    UIBarButtonItem *stop = [[UIBarButtonItem alloc] 
                             initWithBarButtonSystemItem:UIBarButtonSystemItemStop 
                             target:self action:@selector(stopload:)];

    UIBarButtonItem *refresh = [[UIBarButtonItem alloc] 
                             initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh 
                             target:self action:@selector(refreshWeb:)];


    [self.navigationController.toolbar setItems:[NSArray arrayWithObjects:fixspace1, back, fixspace1, stop, fixspace1, next, fixspace1, nil] animated:YES];
    [self.navigationItem setRightBarButtonItem:refresh animated:YES];

    [self.navigationController.view addSubview:self.navigationController.toolbar];

    [stop release];
    [next release];
    [back release];
    [refresh release];
    [fixspace1 release];
}
Run Code Online (Sandbox Code Playgroud)

我用这种方法设置我的按钮

-(void)viewDidAppear:(BOOL)animated …
Run Code Online (Sandbox Code Playgroud)

iphone uibarbuttonitem

3
推荐指数
1
解决办法
2807
查看次数

基于iOS4并部署iOS3的Media Player存在问题

当在Device 3.1.2上运行时,为什么它也传递if(NSClassFromString(@"MPMoviePlayerViewController")!= nil)并且执行iOS4的代码然后它会崩溃,如何解决这个问题?

               if(NSClassFromString(@"MPMoviePlayerViewController") != nil) {
                    // iOS 4 code
                    NSLog(@"MPMoviePlayerViewController");
                    MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:AppDelegate.PushLink]];
                    if (mp) {
                        // save the movie player object
                        self.theMovie4 = mp;
                        [mp release];
                        //Present                       
                        [self presentMoviePlayerViewControllerAnimated:self.theMovie4];

                        // Play the movie!
                        self.theMovie4.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
                        [self.theMovie4.moviePlayer play];
                    }
                }
                else {
                    //iOS 3 Code
                    AppDelegate = nil;
                    AppDelegate = [[UIApplication sharedApplication] delegate];
                    [AppDelegate ForceHideNavigationBar];
                    theMovie3 = nil;

                    [[NSNotificationCenter defaultCenter] addObserver:self 
                                                             selector:@selector(moviePreloadDidFinish:) 
                                                                 name:MPMoviePlayerContentPreloadDidFinishNotification 
                                                               object:theMovie3];

                    [[NSNotificationCenter defaultCenter] addObserver:self 
                                                             selector:@selector(moviePlayBackDidFinish:) 
                                                                 name:MPMoviePlayerPlaybackDidFinishNotification 
                                                               object:theMovie3];

                    // Register to …
Run Code Online (Sandbox Code Playgroud)

iphone media-player ios4

3
推荐指数
1
解决办法
5867
查看次数

3
推荐指数
1
解决办法
542
查看次数

NSMutableArray arrayWithObjects的问题:

NSMutableArray *images = [NSMutableArray arrayWithObjects:[UIImage imageNamed:@"JGirl 01.jpg"],
    [UIImage imageNamed:@"JGirl 03.jpg"], ... ,
    [UIImage imageNamed:@"JGirl 48.jpg"],
    nil];

self.view = [[[SlideShowView alloc] initWithImages:images byIndex:index] autorelease];
Run Code Online (Sandbox Code Playgroud)

假设我的图像包含48个对象,但是当我调试图像时只有23个对象.

为什么我的所有图片都没有加载?

cocoa nsmutablearray

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

如何更改UITabbar选择的颜色?

根据这篇文章 ,苹果现在也会拒绝这个代码吗?

以及如何实施苹果将批准的内容?

@interface UITabBar (ColorExtensions)
- (void)recolorItemsWithColor:(UIColor *)color shadowColor:(UIColor *)shadowColor shadowOffset:(CGSize)shadowOffset shadowBlur:(CGFloat)shadowBlur;
@end

@interface UITabBarItem (Private)
@property(retain, nonatomic) UIImage *selectedImage;
- (void)_updateView;
@end

@implementation UITabBar (ColorExtensions)
- (void)recolorItemsWithColor:(UIColor *)color shadowColor:(UIColor *)shadowColor shadowOffset:(CGSize)shadowOffset shadowBlur:(CGFloat)shadowBlur
{
        CGColorRef cgColor = [color CGColor];
        CGColorRef cgShadowColor = [shadowColor CGColor];
        for (UITabBarItem *item in [self items])
                if ([item respondsToSelector:@selector(selectedImage)] &&
                    [item respondsToSelector:@selector(setSelectedImage:)] &&
                    [item respondsToSelector:@selector(_updateView)])
                {
                        CGRect contextRect;
                        contextRect.origin.x = 0.0f;
                        contextRect.origin.y = 0.0f;
                        contextRect.size = [[item selectedImage] size];
                        // Retrieve source image and …
Run Code Online (Sandbox Code Playgroud)

iphone uitabbarcontroller

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