Unable to use iOS framework which is internally using xib

2014-03-23 Thread Devarshi Kulshreshtha
I am trying to make a universal framework for iOS by following steps
specified in this URL:
http://blog.db-in.com/universal-framework-for-ios/

I have a view controller class within that framework which internally
loads a xib file.
Below is a part of code which shows how I am initializing that view
controller and showing related view:

/*** Part of implementation of SomeViewController class, which is
outside the framework ***/

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

self.viewControllerWithinFramework =
[[ViewControllerWithinFramework alloc] initWithTitle:@"My custom
view"];
}
- (IBAction)showSomeView:(id)sender {
[self.viewControllerWithinFramework showRelatedView];
}

/*** Part of implementation of ViewControllerWithinFramework
class, which is inside the framework ***/

- (id)initWithTitle:(NSString *)aTitle
{
   self = [super initWithNibName:@"ViewControllerWithinFramework"
bundle:nil]; // ViewControllerWithinFramework.xib is within the
framework

   if (self)
   {
   _viewControllerTitle = aTitle;
   }

   return self;
}

While creating the framework, I included all xibs, including
ViewControllerWithinFramework.xib within its 'Copy Bundle Resources'
build phase.

Now my problem is when I try to integrate that framework within other
project, it crashes with below stack trace:

Sample[3616:a0b] *** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Could not load NIB in
bundle: 'NSBundle 
(loaded)' with name 'ViewControllerWithinFramework''
*** First throw call stack:
(
0   CoreFoundation  0x017365e4
__exceptionPreprocess + 180
1   libobjc.A.dylib 0x014b98b6 objc_exception_throw + 44
2   CoreFoundation  0x017363bb +[NSException
raise:format:] + 139
3   UIKit   0x004cc65c -[UINib
instantiateWithOwner:options:] + 951
4   UIKit   0x0033ec95
-[UIViewController _loadViewFromNibNamed:bundle:] + 280
5   UIKit   0x0033f43d
-[UIViewController loadView] + 302
6   UIKit   0x0033f73e
-[UIViewController loadViewIfRequired] + 78
7   UIKit   0x0033fc44
-[UIViewController view] + 35

Any ideas, how could I resolve this problem?

*Note: It works fine if there is no any xib within the framework.*
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Unable to use iOS framework which is internally using xib

2014-03-23 Thread Jens Alfke

On Mar 23, 2014, at 8:09 AM, Devarshi Kulshreshtha 
 wrote:

> While creating the framework, I included all xibs, including
> ViewControllerWithinFramework.xib within its 'Copy Bundle Resources'
> build phase.
> 
> Now my problem is when I try to integrate that framework within other
> project, it crashes with below stack trace:

If you look at the reason listed for the exception, it’s "Could not load NIB in 
bundle”, so presumably the nib isn’t present in the built application. Did you 
follow the step to add the resources from the framework to your application’s 
Copy Resources build phase, as described in that web page?

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Image without profile gets an sRGB profile on Mavericks

2014-03-23 Thread Leonardo
I create a jpg RGB image with Photoshop "without" any icc profile.
I import it in my app.

NSBitmapImageRep*srcRep = [NSBitmapImageRep imageRepWithData:imageData];
NSLog(@"profileName %@", srcRep.colorSpace.localizedName);

On OS X 10.8.5 I properly get "Device RGB".
On Mavericks 10.9.2 I wrongly get "sRGB IEC61966-2.1".

Therefore I can't understand whether the image:
1. has no profile then I have to assign a profile chosen by my user.
2. has its own profile then I do not touch it.

I even tried CGColorSpaceCopyName. Same result.
Did Apple changed its mind on Mavericks giving a profile to all the orphans,
or am I missing some step?


Regards
-- Leonardo


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Image without profile gets an sRGB profile on Mavericks

2014-03-23 Thread Sandy McGuffog
Untagged images are a free-for-all - any app or framework can assume whatever 
it wants for a color space with them, so there’s no “wrongly” about what 
Mavericks does. It’s just different to previous versions. 

So far as I am aware, Apple is (strongly) discouraging the use of Device RGB, 
for the good reason that using it leads to inconsistent results. 

Sandy


On Mar 23, 2014, at 8:14 PM, Leonardo  wrote:

> I create a jpg RGB image with Photoshop "without" any icc profile.
> I import it in my app.
> 
> NSBitmapImageRep*srcRep = [NSBitmapImageRep imageRepWithData:imageData];
> NSLog(@"profileName %@", srcRep.colorSpace.localizedName);
> 
> On OS X 10.8.5 I properly get "Device RGB".
> On Mavericks 10.9.2 I wrongly get "sRGB IEC61966-2.1".
> 
> Therefore I can't understand whether the image:
> 1. has no profile then I have to assign a profile chosen by my user.
> 2. has its own profile then I do not touch it.
> 
> I even tried CGColorSpaceCopyName. Same result.
> Did Apple changed its mind on Mavericks giving a profile to all the orphans,
> or am I missing some step?
> 
> 
> Regards
> -- Leonardo
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/mcguffogl%40gmail.com
> 
> This email sent to mcguff...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Best way to composite/tile multiple CGImages to one image

2014-03-23 Thread Kevin Meaney
I've experimented with trying to get the best performance I can with various 
different approaches by building a command line tool that creates a cover sheet 
of frame grabs from a movie file. I've blogged about my attempts here:

http://blog.yvs.eu.com/2014/03/ssd-versus-hdd-movie-frame-grabs-and-the-importance-of-profiling/

The approach with best results is on the link below (a github rep with multiple 
branches, the branch linked to here is the approach with best results). I'm 
happy with the results though I don't think performance is any better than Jim 
described below. It was an interesting path to follow to see what helped and 
didn't.
https://github.com/SheffieldKevin/makecoversheet/tree/nsoperationlimited

Kevin

On 12 Mar 2014, at 17:47, Jim Crate  wrote:

> 
> On Mar 8, 2014, at 9:17 AM, Trygve Inda  wrote:
> 
>>> On 08 Mar 2014, at 04:38, Trygve Inda  wrote:
 I need to composite/tile about 20 images in a 4x5 grid to one image.
>>> 
>>> What for? Knowing that might help finding a way to speed it up. I.e. why are
>>> the images separate, where are they supposed to go in the end? Display on
>>> screen? Writing to a standard image file format? Something else?
>> 
>> The images are coming from a video file at periodic intervals and are
>> destined for a jpg file consisting of multiple thumbnails stitched together.
>> 
>> The CGImages come from an AVAssetImageGenerator.
>> 
>> Instruments says the time spent in
>> 
>> [imageGenerator copyCGImageAtTime:targetTime actualTime:&actualTime
>> error:&error];
>> 
>> Is small, but the time in CGContextDrawImage is quite large. However, if I
>> comment out the CGContextDrawImage line, then the time spent in
>> copyCGImageAtTime it rather more significant.
>> 
>> I imagine when I get the CGImageRef from copyCGImageAtTime, I am not
>> actually getting any pixel data until it tries to draw in
>> CGContextDrawImage.
> 
> I have an app that does some transformations on images and writes them back 
> to jpegs, and it processes 25 images (1288×1936 pixels) per second on my 2011 
> MBP (2.2 i7), maxing all 8 cores.  Almost 50% of the time is spent in 
> CGContextDrawImage.  I played with the code a bit to use CoreImage instead, 
> and while it performed at roughly the same rate of 25 images per second, most 
> of the CPU time was now spent reading and encoding the jpegs, and CPU time 
> was cut in half.  In my case, the spinning platter hard disk is likely the 
> bottleneck, and the process is fast enough either way.  Since you are writing 
> 1 jpeg for every 20 images, using CoreImage will likely give you a noticeable 
> performance boost.
> 
> Jim Crate
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/ktam%40yvs.eu.com
> 
> This email sent to k...@yvs.eu.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Image without profile gets an sRGB profile on Mavericks

2014-03-23 Thread Kevin Meaney
I read somewhere that this change was part of Mavericks. I can't track that 
reference down right now, but I don't think Apple would consider it an error.

Kevin

On 23 Mar 2014, at 18:14, Leonardo  wrote:

> I create a jpg RGB image with Photoshop "without" any icc profile.
> I import it in my app.
> 
> NSBitmapImageRep*srcRep = [NSBitmapImageRep imageRepWithData:imageData];
> NSLog(@"profileName %@", srcRep.colorSpace.localizedName);
> 
> On OS X 10.8.5 I properly get "Device RGB".
> On Mavericks 10.9.2 I wrongly get "sRGB IEC61966-2.1".
> 
> Therefore I can't understand whether the image:
> 1. has no profile then I have to assign a profile chosen by my user.
> 2. has its own profile then I do not touch it.
> 
> I even tried CGColorSpaceCopyName. Same result.
> Did Apple changed its mind on Mavericks giving a profile to all the orphans,
> or am I missing some step?
> 
> 
> Regards
> -- Leonardo
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/ktam%40yvs.eu.com
> 
> This email sent to k...@yvs.eu.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Image without profile gets an sRGB profile on Mavericks

2014-03-23 Thread Kevin Muldoon

As Sandy says, its not a matter of right/wrong. Simply expected vs. unexpected. 

Sure, if I save an image with a profile and immediately ask what profile the 
image is tagged with, I would expect the result of nil, not sRGB.

However, there is a certain brilliance to having all nil profiles default to 
sRGB. It's a damn fine idea. However, the question becomes

a) Does the image REALLY have an embedded profile?

b) If so, When/What put that profile there? (Probably quickly tested by 
measuring the size of the image)

c)  If not, should the framework REALLY say there was? I'd think the 
responsibility of assigning a default profile for non-tagged images should be 
higher up the food chain.


On Mar 23, 2014, at 2:41 PM, Sandy McGuffog  wrote:

> Untagged images are a free-for-all - any app or framework can assume whatever 
> it wants for a color space with them, so there’s no “wrongly” about what 
> Mavericks does. It’s just different to previous versions. 
> 
> So far as I am aware, Apple is (strongly) discouraging the use of Device RGB, 
> for the good reason that using it leads to inconsistent results. 
> 
> Sandy
> 
> 
> On Mar 23, 2014, at 8:14 PM, Leonardo  wrote:
> 
>> I create a jpg RGB image with Photoshop "without" any icc profile.
>> I import it in my app.
>> 
>> NSBitmapImageRep*srcRep = [NSBitmapImageRep imageRepWithData:imageData];
>> NSLog(@"profileName %@", srcRep.colorSpace.localizedName);
>> 
>> On OS X 10.8.5 I properly get "Device RGB".
>> On Mavericks 10.9.2 I wrongly get "sRGB IEC61966-2.1".
>> 
>> Therefore I can't understand whether the image:
>> 1. has no profile then I have to assign a profile chosen by my user.
>> 2. has its own profile then I do not touch it.
>> 
>> I even tried CGColorSpaceCopyName. Same result.
>> Did Apple changed its mind on Mavericks giving a profile to all the orphans,
>> or am I missing some step?
>> 
>> 
>> Regards
>> -- Leonardo
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/mcguffogl%40gmail.com
>> 
>> This email sent to mcguff...@gmail.com
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/caoimghgin%40gmail.com
> 
> This email sent to caoimgh...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com