• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: warning: initialization makes pointer from integer without a cast
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: initialization makes pointer from integer without a cast


  • Subject: Re: warning: initialization makes pointer from integer without a cast
  • From: Shawn Erickson <email@hidden>
  • Date: Fri, 24 Apr 2009 13:51:25 -0700

On Fri, Apr 24, 2009 at 1:43 PM, Sandy Santra <email@hidden> wrote:
> That's the error, here's the code:
> void PrintProcessInfo() {
> NSString *processName = [[NSProcessInfo processInfo] processName];
> NSString *processIdentifier = [[NSProcessInfo processInfo]
> processIdentifier]; //Line 2 (must be a better way!)
> NSLog(@"Process Name: '%@'.", processName);
> NSLog(@"Process ID: '%i'.", processIdentifier);
> }
> My output is fine:
> 2009-04-24 16:37:29.957 Test[31166:10b] Process Name: 'Test'.
> 2009-04-24 16:37:29.957 Test[31166:10b] Process ID: '31166'.
> but I'm going nuts over this error (warning).  Any help appreciated.  I've
> just spent way too many hours trying to figure this out.  Documentation says
> the method for the ID is "- (int)processIdentifier" but I don't know how to
> work that into this code.

int processIdentifier = [[NSProcessInfo processInfo] processIdentifier];
NSLog(@"Process ID: '%d'.", processIdentifier);

If this is confusing to you I encourage you to find a good book or
online resource on the C programming language.

-Shawn
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >warning: initialization makes pointer from integer without a cast (From: Sandy Santra <email@hidden>)

  • Prev by Date: Re: warning: initialization makes pointer from integer without a cast
  • Next by Date: Re: warning: initialization makes pointer from integer without a cast
  • Previous by thread: Re: warning: initialization makes pointer from integer without a cast
  • Next by thread: Re: warning: initialization makes pointer from integer without a cast
  • Index(es):
    • Date
    • Thread