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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:03:59+00:00 2026-05-26T23:03:59+00:00

iOS 5.0 SDK I have a method that took a parameter as a ‘type’

  • 0

iOS 5.0 SDK

I have a method that took a parameter as a ‘type’ that I defined. Lets call it ‘Places’. This type was defined as the following:

typedef enum {
    kBar = 0,
    kRestaurant = 1,
    kCafe = 2
} Places

My method would take a parameter of Places.

Based on the Place type passed in, I would append the type to the url:

ex: http://www.domain.com/place=1

However, the url parameter cannot be a number it has to be a string.

ex: http://www.domain.com/place=restaurant

I know enums cannot be strings so I am trying to figure out the right approach for this. Do I have a plist and then read the plist into a dictionary? Is there another 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-05-26T23:04:00+00:00Added an answer on May 26, 2026 at 11:04 pm

    I would do something like:

    typedef enum {
        PlaceTypeBar = 0,
        PlaceTypeRestaurant = 1,
        PlaceTypeCafe = 2
    } PlaceType
    
    
    @interface PlaceTypeHelper : NSObject
        + (NSString *) stringForPlace:(PlaceType)place;
    @end
    
    @implementation
    
    + (NSString *) stringForPlace:(PlaceType)place {
        NSArray *places = [NSArray arrayWithobjects:@"Bar", @"Restaurant", @"Cafe", nil];
    
       return [places objectForKey:(NSInteger)place];
    }
    
    @end
    

    Headups, I’ve no tested the code yet.

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

Sidebar

Related Questions

I have my current base sdk set to iOS 4.2. I have this method:
I wrote a quick objective-C method that uses Amazon's AWS iOS SDK to synchronously
I have this strange issue. The applicationDidBecomeActive method is called correctly in the iOS
Anyone have any idea about CASlotProxy Class in Cocoa (iOS SDK)? I found it
The iOS and OS X Sdk have a very cool concept of toll-free bridging.
I'm using the Facebook iOS SDK . In my code I have authorized my
I have an app prototype that was working on Iphone4 + iOS 4.3, build
I have a strange issue trying to run the Facebook iOS SDK DemoApp (from
Possible Duplicate: UISlider and UIScrollView using iOS SDK 4.3. I've found when I have
Using AdMob in MonoTouch Projects with iOS SDK 4.2 We have a test project

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.