Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8550121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:52:43+00:00 2026-06-11T13:52:43+00:00

I am getting the following error: I can’t seem what is wrong with my

  • 0

I am getting the following error:

enter image description here

I can’t seem what is wrong with my code. Here’s some code in my AHInstagramImageData

-(id)initWithData:(NSDictionary *)data
{
    self = [super init];
    if (!self) {
        return nil;
    }

for (NSDictionary * comment in imgCmt){
        AHInstagramImageComment * instagramImgComment  = [[AHInstagramImageComment alloc] initWithData:comment];
        [comments insertObject:instagramImgComment atIndex:0];
        [instagramImgComment release];
    }
}

and then on the AHInstagramImageComment I have:

-(id)initWithData:(NSDictionary *)data
{
    self = [super init];
    if (!self) {
        return nil;
    }

    [self calculateCommentsHeight];

    return self;
}

- (void) calculateCommentsHeight
{
    NSString *combinedComment = [NSString stringWithFormat:@"%@ %@", self.username, self.text];
    CGFloat desiredHeight = [combinedComment sizeWithFont:[UIFont fontWithName:@"HelveticaNeue" size:14] constrainedToSize:CGSizeMake(kCommentsMaxWidth, CGFLOAT_MAX) lineBreakMode:UILineBreakModeClip].height;

    if (desiredHeight >= 50){
        commentHeight_ = desiredHeight;
    } else {
        commentHeight_ = 50;
    }

    commentHeight_ += kTimestampMaxHeight;
    commentHeight_ += 5;
}

So essentialy I had initializing the AHInstagramImageData in a background queue:

 [weakSelf.backgroundQueue_ addOperationWithBlock:^{
                             NSArray *arr = [response valueForKey:@"data"];
                             int startingIndex = [[AHImageDataSource sharedDataSource] count];
                             for (NSDictionary * data in arr){
                                 AHInstagramImageData * imgData = [[AHInstagramImageData alloc] initWithData:data];

}
}];

Is any of these wrong ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:52:45+00:00Added an answer on June 11, 2026 at 1:52 pm

    I had a problem similiar to this before. There is currently a bug which prevents [NSString sizeWithFont:] and [NSString drawInRect:] to run on background threads, or via NSOperations.

    See this link:
    Bug in UIKit string drawing method?

    You have a few options:

    1. Don’t use sizeWithFont: with NSOperations.
    2. Set max operation count on your NSOperationQueue to 1:

      [queue setMaxConcurrentOperations:1];

    3. Use Core Text and NSAttributedStrings, which have their own “sizeWithFont” method: CTFramesetterSuggestFrameSizeWithConstraints

    4. Use [NSOperationQueue mainQueue]; to run operations on the main thread.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why am I getting the following error in my code? Fatal error: Can't use
I'm getting the following error message and I can't seem to figure out the
I am getting null-exception throw error in the following code. What can be the
i am getting following error while getting data from dictionary -[__NSCFString objectForKey:]: unrecognized selector
I keep getting the following error: * #1005 - Can't create table 'classorganizer.turma' (errno:
I'm getting the following error and can't for the life of me figure out
I am getting following error while starting apache. Can't locate /usr/sbin/webmux.pl in @INC (@INC
I'm getting the following error in subsonic: Can't decide which property to consider the
I am getting following error while executing my java code. What is this error
I am getting the following error: Can't convert String into Integer (TypeError) It is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.