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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:46:52+00:00 2026-05-27T07:46:52+00:00

I am creating one application in iOs 5 using story board and in that

  • 0

I am creating one application in iOs 5 using story board and in that application I need to use one NSMutableArray for table View.
so I am creating that array as shown below.
but in iOs 4 we creating array like

@interface MySpots : UITableViewController{
       NSMutableArray *MySpots;
}
@property (nonatomic, strong) NSMutableArray *MySpots;

and in .m file

@synthesize MySpots;
- (void)viewDidLoad

{
     [super viewDidLoad];
      MySpots = [[NSMutableArray alloc]init];
      for (int i = 0; i<10; i++) {
          mySpot.SpotName = @"Name Of Spot";
          mySpot.SpotTime = @"15mi";
          mySpot.SpotDis = @"Short preview of the description will appear in this section.Acts as a reminder for relevant";
          [MySpots addObject:mySpot];
       }

}

but when i try to do this in iOs 5 it will show me error(“Expected identifier or {” ) on

MySpots = [[NSMutableArray alloc]init];

because in iOs 5 no need to release. so how should i have to declare NSMutableArray in iOs 5 .
thanks in advance 🙂

  • 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-05-27T07:46:52+00:00Added an answer on May 27, 2026 at 7:46 am

    This has nothing to do with iOS 5 but rather is a compiler error from objective C. The basic problem is that you use MySpots both as interface name and as property/instance variable. When encountering your line

    MySpots = [[NSMutableArray alloc]init];
    

    the compiler now is unsure if this is the variable MySpots or should be a declaration of a variable of type MySpots, e.g.

    MySpots *mySecondController = ...;
    

    The compiler assumes the second and bails out because of the missing variable name.

    You should

    1. change that property’s name to something different than the class name to avoid confusion
    2. use self.property = instead of property = because this uses the correct memory management. ARC somewhat reduces this problem but it is good practice anyway to use the automatic retain/release provided by properties.

    Either one of those would help (in case 1 the compiler now is clear on what to do, in case 2 self.MySpots would be a unique name and could not be mixed up with the class name) but I would definitely do both, rename the property (or class) and use self.property =.

    PS: Even with ARC you still initialize as usual by using [[NSMutableArray alloc] init] ARC just inserts the appropriate retain and releases behind the scenes.

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

Sidebar

Related Questions

I've been playing around with creating an application using the S#arp Architecture . One
I am creating one application in .net MVC, in which I am using jQuery
I am creating an iPad application for ios 5 using arc and storyboard in
I am creating one application in which I am using resource files to keep
I am creating one application in that i want to give background effect like
I am creating navigation based iphone application.In that i have to move from one
I am creating one application in which i am using jsp/servlet.. I want to
I am creating one application for student. I need to set the different message
I'm working on creating a self updating application and one issue I'm running into
I'm creating an iPad application which needs a UIPopoverController like this one (I mean,

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.