Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-28-2009, 06:33 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
BlackSoil is on a distinguished road
Default [Ask] About #define

I'm making a class file, something like this :
myclass.h file :
- (void) requestnsstring*)url reqTypeint)type;

myclass.m file :

#define POST = 2;
#define FTL = 1;
@implement...

when i call request like this :
[self request:@"somestring" reqType:FTL];

error pop-up saying, error, expected ] before ;

my question is, how exactly to use define? in my case i want to have FTL = 1 value and POST = 2 value. How exactly to do

thx before.
BlackSoil is offline   Reply With Quote
Old 08-28-2009, 08:18 AM   #2 (permalink)
Former NeXTStep Developer
 
Join Date: Mar 2009
Posts: 997
FlyingDiver will become famous soon enough
Default

There's no equal sign or semicolon in a #define statement:

Code:
#define POST 2
#define FTL  1
joe
FlyingDiver is offline   Reply With Quote
Old 08-28-2009, 09:20 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
BlackSoil is on a distinguished road
Default

Still doesn't worked..


any idea??
BlackSoil is offline   Reply With Quote
Old 08-28-2009, 09:49 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
BlackSoil is on a distinguished road
Default

still no luck.... so i use this

int i = FSTL;
[self request:friends_timeline_url reqType:i];

solution still needed though.. anyway thanks you joe..
BlackSoil is offline   Reply With Quote
Old 08-28-2009, 09:53 AM   #5 (permalink)
Former NeXTStep Developer
 
Join Date: Mar 2009
Posts: 997
FlyingDiver will become famous soon enough
Default

Quote:
Originally Posted by BlackSoil View Post
still no luck.... so i use this

int i = FSTL;
[self request:friends_timeline_url reqType:i];

solution still needed though.. anyway thanks you joe..
You still have the semicolon on the #define. Take it off. The way you have it, the compiler is doing the substitution and giving you:

Code:
[self request:friends_timeline_url reqType:1;];
Which is obviously wrong.

joe
FlyingDiver is offline   Reply With Quote
Old 08-28-2009, 11:09 AM   #6 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
BlackSoil is on a distinguished road
Default

thanksssss.......
BlackSoil is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 457
15 members and 442 guests
Domele, Duncan C, Feldspar, karatebasker, MacBook MH, Objective Zero, patapple, peterwilli, pipposanta, PixelInteractive, Punkjumper, rubyeim54, SLIC, taylor202, Today's Posts
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,694
Threads: 94,137
Posts: 402,950
Top Poster: BrianSlick (7,990)
Welcome to our newest member, peterwilli
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:03 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0