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 
Ok, no problem. At least for the simple ones (just assign value a or b) I use ? very often as it makes the code more compact.
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.
>