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

  • Home
  • SEARCH
  • 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 7971495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:39:11+00:00 2026-06-04T07:39:11+00:00

This how i construct my PLIST. <dict> <key>level1</key> <dict> <key>formation</key> <dict> <key>height</key> <integer>34</integer> <key>width</key>

  • 0

This how i construct my PLIST.

<dict>
<key>level1</key>
<dict>
<key>formation</key>
<dict>
    <key>height</key>
    <integer>34</integer>
    <key>width</key>
    <integer>12</integer>

</dict>
</dict>
</dict>

level>formation>data

This is the example code i used, but it didnt work.

//init loading from PLIST here, and then associate value.
NSString *pathString=[NSString stringWithFormat:@"%@Levels",targetWorld];
NSString *path = [[NSBundle mainBundle] pathForResource:pathString ofType:@"plist"];
NSString *levelNameNumber = [[NSString alloc] initWithFormat:targetLevel];

NSDictionary *levelsList = [[NSDictionary alloc] initWithContentsOfFile:path];
NSDictionary *level = [levelsList objectForKey:levelNameNumber];

NSEnumerator *levelFormations = [level objectEnumerator];

for( NSDictionary *worldSize in levelFormations )
{
    worldWidth = [[worldSize objectForKey:@"width"] intValue];
    worldHeight = [[worldSize objectForKey:@"height"] intValue];

    NSLog(@"height is %d",worldHeight);
    NSLog(@"width is %d",worldWidth);

}

[levelNameNumber release];
[levelsList release];

problem with this code is that it runs a second for loop and returns both the height and width to ZERO.

Any idea? or how do i do it the proper way?

  • 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-04T07:39:13+00:00Added an answer on June 4, 2026 at 7:39 am

    Since you’re using an object from levelsList, and you’re releasing levelsList at the end, the level object you got from the dictionary will also be released. You either need to not release levelsList, retain level, or preferably start using ARC.

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

Sidebar

Related Questions

The other day, I came across this construct: static_cast<size_type>(-1) in some example C++ code,
Somewhere in lines of code, I came across this construct... //void* v = void*
I was tying to optimize a piece of code that has this construct: while
Referring to this construct, posting a full example would be a little too big:
I just inherited some code that has this construct: <target name=foo depends=-read.SOME.STRING, bar1, bar2>
I understand how this construct works: for i in range(10): print(i) if i ==
Given some typical search form, I can't construct this form action when submitting a
Which construct is better suited for this situation, an if-else or a switch? -
This is a simple question but I don't know how to construct a variable
This question builds on the following question (s) Indexing : How do I construct

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.