simplify mobiledevice.c -> rename to mobiledevice.m and use NSSttring instead of CFString and ARC

saves about 100 lines of code and makes string deallocation a bit more safe 
Mario, I have committed and pushed my changes. I don’t know if I need to do another pull request now (I’m quite new to git and github), seems unnecessary.
Let me know if I need to do additional changes.
Regards ,Leo
On 22.10.2014, at 13:36, Mário Freitas <notifications@github.com> wrote:

> In mobiledevice.m:
> 
> > +  ASSERT_OR_EXIT(AMDeviceIsPaired(device), "!AMDeviceIsPaired\n");
> > +  ASSERT_OR_EXIT(!AMDeviceValidatePairing(device), "!AMDeviceValidatePairing\n");
> > +  ASSERT_OR_EXIT(!AMDeviceStartSession(device), "!AMDeviceStartSession\n");
> > +}
> > +
> > +static NSString* get_bundle_id(const char *app_path)
> > +{
> > +  NSString* path=[NSString stringWithUTF8String:app_path];
> > +  path=[path stringByAppendingPathComponent:@"Info.plist"];
> > +  NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
> > +  return dict[@"CFBundleIdentifier"];
> > +}
> > +
> > +static void get_udid(struct am_device *device)
> > +{
> > +  NSString* udid = (__bridge NSString*) AMDeviceCopyDeviceIdentifier(device);
> I want to avoid ? one liners as much as possible so, I would see this code as:
> 
> if (udid == nil)
> {
>   unregister_device_notification(1);
> }
> else
> {
>   printfNS(@"%@\n", udid);
>   unregister_device_notification(0);
> }
> —
> Reply to this email directly or view it on GitHub.
>