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 7765993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:18:12+00:00 2026-06-01T15:18:12+00:00

What is wrong with this I am getting EXEC_BAD self.allLessonsArray = [NSArray arrayWithObjects: [NSDictionary

  • 0

What is wrong with this I am getting EXEC_BAD

self.allLessonsArray = [NSArray arrayWithObjects: [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects:@"Title", @"Description", @"LessonID", @"LessonSuffix", @"LibraryImage", @"Price", @"IsFree", nil] forKeys: [NSArray arrayWithObjects: @"First Lesson", @"This is a test description of our first lesson, this lesson is just a copy of Sample StoryApp which we will replace with our first Color Lesson for Very Small Kids. Design of that lesson is still to be discussed with our designer.", 1, @"Less1", @"LibLess1Image.jpg", 0, 1, nil]], [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects:@"Title", @"Description", @"LessonID", @"LessonSuffix", @"LibraryImage", @"Price", @"IsFree", nil] forKeys: [NSArray arrayWithObjects: @"Second Lesson", @"I want to give some description to this title but its so time consuming and boring to write. So here i go - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", 2, @"Less2", @"LibLess2Image.png", 0.99, 0, nil]], nil];

Formatted:

self.allLessonsArray = [NSArray arrayWithObjects: 
                        [NSDictionary dictionaryWithObjects: 
                         [NSArray arrayWithObjects:
                          @"Title",
                          @"Description",
                          @"LessonID",
                          @"LessonSuffix",
                          @"LibraryImage",
                          @"Price",
                          @"IsFree",
                          nil] 
                                                    forKeys: 
                         [NSArray arrayWithObjects:
                          @"First Lesson", 
                          @"This is a test description of our first lesson, this lesson is just a copy of Sample StoryApp which we will replace with our first Color Lesson for Very Small Kids. Design of that lesson is still to be discussed with our designer.",
                          1, 
                          @"Less1",
                          @"LibLess1Image.jpg",
                          0, 
                          1, 
                          nil]
                         ], 
                        [NSDictionary dictionaryWithObjects: 
                         [NSArray arrayWithObjects:
                          @"Title", 
                          @"Description", 
                          @"LessonID", 
                          @"LessonSuffix",
                          @"LibraryImage", 
                          @"Price",
                          @"IsFree",
                          nil] 
                                                    forKeys: 
                         [NSArray arrayWithObjects: 
                          @"Second Lesson",
                          @"I want to give some description to this title but its so time consuming and boring to write. So here i go - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", 
                          2, 
                          @"Less2",
                          @"LibLess2Image.png", 
                          0.99,
                          0,
                          nil]
                         ], 
                        nil];
  • 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-01T15:18:13+00:00Added an answer on June 1, 2026 at 3:18 pm

    NSArray objects can only contain objects. Each integer need to be converted to a NSNumber.

    In particular the second embedded NSArray contains

    0, 1
    

    which should be

    [NSNumber nunberWithInt:0], [NSNumber nunberWithInt:1]
    

    Or made strings:

    @"0", @"1"
    

    Please break out the embedded NSArrays and NSDictionary into separate statements for readability. More clearly written code would probably make it easier to find errors.

    Example:

    NSArray *lessonKeys = [NSArray arrayWithObjects:@"Title", @"Description", @"LessonID", @"LessonSuffix", @"LibraryImage", @"Price", @"IsFree", nil];
    NSArray *lesson1Values = [NSArray arrayWithObjects: @"First Lesson", @"This is a test description of our first lesson, this lesson is just a copy of Sample StoryApp which we will replace with our first Color Lesson for Very Small Kids. Design of that lesson is still to be discussed with our designer.", [NSNumber numberWithInt:0], @"Less1", @"LibLess1Image.jpg", [NSNumber numberWithInt:0], [NSNumber numberWithInt:1], nil];
    NSArray *lesson2Values = [NSArray arrayWithObjects: @"Second Lesson", @"I want to give some description to this title but its so time consuming and boring to write. So here i go - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", [NSNumber numberWithInt:2], @"Less2", @"LibLess2Image.png", [NSNumber numberWithFloat:0.99 ], [NSNumber numberWithInt:0], nil];
    
    NSDictionary *lesson1 = [NSDictionary dictionaryWithObjects: lesson1Values forKeys: lessonKeys];
    NSDictionary *lesson2 = [NSDictionary dictionaryWithObjects: lesson2Values forKeys: lessonKeys];
    
    self.allLessonsArray = [NSArray arrayWithObjects: lesson1, lesson2, nil];
    

    I make a guess at better var names. Also better formatting is possible for the arrays. Notice the elimination of the duplicate NSArray lessonKeys.

    Still this might be better in a plist file that is read. That would allow making changes and adding lessons without requiring code changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there anything wrong with this code? My entity is not getting updated. public
Can someone please tell me whats wrong with this code. I'm not getting complete
I am getting a wrong output when i alert this, it shows '01' <input
I cannot understand why I am getting deadlock in this simple sample.What is wrong
i wonder if i'm doing anything wrong or I am just getting this wrong?
whats wrong with this code and i am getting this error: Compiler Error Message:
Please tell me where I have gone wrong in this script. I am getting
despite some tips, I'm still getting this one wrong. I end up with one
Whats wrong with this code? -(void) drawRect:(CGRect) rect { CGContextRef c = UIGraphicsGetCurrentContext(); if
Whats wrong with this picture? Model: validates_acceptance_of :terms_of_service, :on => :create, :accept => true,

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.