Reg: Image editing using iPhone SDK

2009-12-16 Thread Sravanthi


Hi,

Is it possible to do image editing like Washout the background of the  
image using iPhone SDK? if so please update me.
if not what are the alternative ways to achieve this. Any help is  
greatly appreciated.


Thanks in advance,
Sravanthi.








___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: memcpy with 64 bit

2009-12-16 Thread gMail.com
Hi David,
I am trying to port my "movie-on-opengl-surface" to the 64-bit architecture.
In my old project I do:

Load a QTMovie
Create an Offscreen GWorld
Upload the texture to OpenGL with glTexImage2D
Update the texture with glTexSubImage2D only when the QT frame has been
drawn, so I need a SetMovieDrawingCompleteProc callback
Also I need the other APIs like IsMovieDone, MoviesTask...

I guess there should be a brand new way to do all of that (at low level). If
so, could you please give me some pointer? Thank you.

--
Leo

> Da: David Duncan 
> Data: Tue, 15 Dec 2009 12:32:39 -0800
> A: "gMail.com" 
> Cc: cocoa-dev Dev 
> Oggetto: Re: memcpy with 64 bit
> 
> On Dec 15, 2009, at 12:22 PM, gMail.com wrote:
> 
>> I agree. Anyway, I can't use some APIs from QuickTime.
>> Do you know any replacement for 64-bit Intel + 10.6 only?
>> 
>>MoviesTask
>>SetMovieDrawingCompleteProc
>>SetMovieGWorld
>>UnlockPixels
> 
> 
> Asking how to replace APIs usually leads to people asking "What are you trying
> to do?"
> 
> So... what are you trying to do? :).
> --
> David Duncan
> Apple DTS Animation and Printing
> 


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: memcpy with 64 bit

2009-12-16 Thread Jean-Daniel Dupas
Even on 32 bits, the recommended way is to use a QTOpenGLVisualContext  and 
CoreVideo, not QuickDraw and upload the texture yourself.

Unfortunately there is no equivalent in 64 bits yet.

But if your need are just to draw the movie, you should use a QTMovieView which 
do this for you.

And if you want to apply some filter to the image, you can use the QTMovieView 
delegate method:

- (CIImage *)view:(QTMovieView *)view willDisplayImage:(CIImage *)image


Le 16 déc. 2009 à 10:09, gMail.com a écrit :

> Hi David,
> I am trying to port my "movie-on-opengl-surface" to the 64-bit architecture.
> In my old project I do:
> 
> Load a QTMovie
> Create an Offscreen GWorld
> Upload the texture to OpenGL with glTexImage2D
> Update the texture with glTexSubImage2D only when the QT frame has been
> drawn, so I need a SetMovieDrawingCompleteProc callback
> Also I need the other APIs like IsMovieDone, MoviesTask...
> 
> I guess there should be a brand new way to do all of that (at low level). If
> so, could you please give me some pointer? Thank you.
> 
> --
> Leo
> 
>> Da: David Duncan 
>> Data: Tue, 15 Dec 2009 12:32:39 -0800
>> A: "gMail.com" 
>> Cc: cocoa-dev Dev 
>> Oggetto: Re: memcpy with 64 bit
>> 
>> On Dec 15, 2009, at 12:22 PM, gMail.com wrote:
>> 
>>> I agree. Anyway, I can't use some APIs from QuickTime.
>>> Do you know any replacement for 64-bit Intel + 10.6 only?
>>> 
>>>   MoviesTask
>>>   SetMovieDrawingCompleteProc
>>>   SetMovieGWorld
>>>   UnlockPixels
>> 
>> 
>> Asking how to replace APIs usually leads to people asking "What are you 
>> trying
>> to do?"
>> 
>> So... what are you trying to do? :).
>> --
>> David Duncan
>> Apple DTS Animation and Printing
>> 
> 
> 
> ___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org
> 
> This email sent to devli...@shadowlab.org
> 

-- Jean-Daniel




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [iPhone] Sample code for live camera stream?

2009-12-16 Thread Gabriel Zachmann

> Ah that's probably why the message in the forums says that it will be 
> superceded in the future, for proper naming and hopefully slightly more 
> functionality).

So there is at least some hope that this function won't got away ... that's 
good news.

Could you please point me to the forum(s) where this was discussed?

Regards,
Gabriel.




smime.p7s
Description: S/MIME cryptographic signature
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: App works when launched from Xcode, not from Finder

2009-12-16 Thread PCWiz
Hi Joar,

Thanks for the reply.

What I did to add the frameworks was add the frameworks to my Linked Frameworks 
and created a new Copy Build phase (target was the Frameworks folder) and then 
added the frameworks to that phase.

I checked out the link and it tells me to set the Installation Build setting of 
the framework build Target. However, I am using precompiled frameworks. Would 
recompiling the frameworks with that setting changed work?

I checked that setting on both of the frameworks I'm using. One has it set to 
@loader_path/../Frameworks and the other one has it set to 
@executable_path/../Frameworks (as it should). Would changing @loader_path to 
@executable_path in the other framework make a difference?

On 2009-12-15, at 11:11 PM, Joar Wingfors wrote:

> 
> On 15 dec 2009, at 16.48, PCWiz wrote:
> 
>> I have 2 frameworks set in a Copy Files build phase and both are being 
>> copied as they should.
> 
> 
> So you intend for your frameworks to be copied into and used from the bundle 
> of your app? If so, have you set their Installation Directory build setting 
> to "@executable_path/../Frameworks"? If not, that would probably explain why 
> it works from Xcode, but not from Finder. See:
> 
> 
> 
> Xcode sets DYLD_FRAMEWORK_PATH to your build folder, so your app will pick up 
> any copies of your frameworks found there when launched from Xcode.
> 
> j o a r
> 
> 

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: App works when launched from Xcode, not from Finder

2009-12-16 Thread PCWiz
Ok, this just got even weirder.

When I launch the app in Release mode from Xcode, something strange happens. 
*2* instances of the app are opened. Both instances work fine however.

Now when I launch the Release app from Finder, 2 instances are opened once 
again. However this time, one instance of the app gives me authentication 
errors, and the other works fine.

This is making absolutely 0 sense to me, and right now it seems like its a 
screwup on Xcode's part. I can privately email the source if necessary (its a 
commercial app, but right now I'm willing to do anything to get this fixed).

Thanks

On 2009-12-15, at 11:11 PM, Joar Wingfors wrote:

> 
> On 15 dec 2009, at 16.48, PCWiz wrote:
> 
>> I have 2 frameworks set in a Copy Files build phase and both are being 
>> copied as they should.
> 
> 
> So you intend for your frameworks to be copied into and used from the bundle 
> of your app? If so, have you set their Installation Directory build setting 
> to "@executable_path/../Frameworks"? If not, that would probably explain why 
> it works from Xcode, but not from Finder. See:
> 
> 
> 
> Xcode sets DYLD_FRAMEWORK_PATH to your build folder, so your app will pick up 
> any copies of your frameworks found there when launched from Xcode.
> 
> j o a r
> 
> 

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: App works when launched from Xcode, not from Finder

2009-12-16 Thread Joar Wingfors

On 16 dec 2009, at 07.04, PCWiz wrote:

> This is making absolutely 0 sense to me, and right now it seems like its a 
> screwup on Xcode's part. I can privately email the source if necessary (its a 
> commercial app, but right now I'm willing to do anything to get this fixed).


That doesn't make any sense to me either. I doubt that the launching of two 
copies is Xcode's fault though.

Zip up your source and send it to me, and I'll take a look.

j o a r


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Notification based toolbar design pattern

2009-12-16 Thread jonat...@mugginsoft.com
My app toolbar design pattern is as follows. My question concerns the nature of 
this design.

1. The App has four or five window subclasses, each with separate, dynamic, 
toolbars.
2. Most of the toolbar items are views.
3. A toolbar controller factory class generates instances of toolbars for a 
particular window.
4. Each toolbar item has its own controller class as a target.

When a tool bar item is selected an action is sent to the item's controller 
target for initial decision making.
The controller then generally dispatches a notification.

I have not used KVO, nil targeted actions or delegates here for several reasons:

1. In may cases the ultimate receiver is deep down in the object hierarchy and 
obtaining the delegate reference/observer target can involve traversing a lot 
of classes.

2. NSViewController is not part of the responder chain (though I know the chain 
can be customised to permit this) which makes nil targeting less effective.
   (in the absence of custom NSView subclasses the action has to hit the 
window, window delegate, or App delegate before it can be retargeted)

3. Some of the application views are reused in several different windows with 
different toolbars. Notifications don't care about the receiver's relative 
position.

The notification based system does work but seems heavy handed when compared to 
say the elegance of the responder chain.

Eg:
MyAppChangeViewConfigRequest notifications are sent from the tool bar to change 
the application's view configuration.
If and when the view configuration request succeeds a MyAppDidChangeViewConfig 
notification is sent out.

If the view configuration is changed from the menu then the same 
MyAppChangeViewConfigRequest and MyAppDidChangeViewConfig notifications are 
sent.
Tool bar items, via their controller, observe the MyAppDidChangeViewConfig 
notification and update their state accordingly.

On the other hand  a notification based system is flexible.
I can move the notification's receiver about in the class hierarchy while 
developing without worrying about 
the receiver's accessibility as a target or wether I have broken the responder 
chain.
If another view needs to get in on the act then it just becomes another 
observer of the MyAppDidChangeViewConfig notification.

My question is, is the use of notifications common in toolbar implementation or 
have I missed a trick by not sticking firmly to targeted actions, nil or 
otherwise?
Do other developers find implementing moderately complex toolbar subsystems 
challenging?

Sorry this is long.

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com






Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Warning about comparison between pointer and integer

2009-12-16 Thread Eric E. Dolecki
I am using NSUserDefaults to store some data. On first run of the
application, I check for the data, and if it's not been set already, I set
it.

I however get warnings in my code. In my .h I set up my variables, and then
in my .m:

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

alarm1_hour = [prefs integerForKey:@"alarm1Hour"];

if( alarm1_hour == NULL ){

  NSLog(@"alarm 1 hour is null" );

}

Should I use a temporary variable to check instead of the variable with the
pointer? Or are these warnings okay to ignore?
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Cannot use malloc debug

2009-12-16 Thread Phi Le
Hello,

I can't run malloc debug. Even on a simple program (Xcode -> New
Project -> Application -> Cocoa Application ), without any
modification the default project.  I am developing on a Macbook Pro -
10.6.2 with Xcode 3.1.4.  Thank you for you help.

Here is my crash report:
Process: Tester [60948]
Path:
/Users/phi/workspace/Tester/build/Debug/Tester.app/Contents/MacOS/Tester
Identifier:  com.yourcompany.Tester
Version: ??? (1.0)
Code Type:   X86 (Native)
Parent Process:  MallocDebug [60946]

Date/Time:   2009-12-16 08:10:17.898 -0800
OS Version:  Mac OS X 10.6.2 (10C540)
Report Version:  6

Interval Since Last Report:  794462 sec
Crashes Since Last Report:   37
Per-App Interval Since Last Report:  1 sec
Per-App Crashes Since Last Report:   1

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.CoreFoundation0x93f35413 CFQSortArray + 259
1   com.apple.CoreFoundation0x93f16249 CFArraySortValues + 489
2   com.apple.ColorSync 0x98fb799d
ColorSyncProfileCopyTagSignatures + 175
3   com.apple.ColorSync 0x98fe2d30 CMMProfile::Usable() + 62
4   com.apple.ColorSync 0x98fe2675 DoValidateProfile + 74
5   com.apple.ColorSync 0x98fe278d AppleCMMValidateProfile + 28
6   com.apple.ColorSync 0x98fb8a4d ColorSyncProfileVerify + 31
7   libCSync.A.dylib0x97d9cb84 validateProfile + 65
8   libCSync.A.dylib0x97d9cae9 CMSValidateProfile + 60
9   com.apple.CoreGraphics  0x908c97e0 
CGCMSInterfaceValidateProfile + 27
10  com.apple.CoreGraphics  0x908c97c0 CGCMSUtilsValidateProfile + 
24
11  com.apple.CoreGraphics  0x908c96bf CGColorSpaceCreateICCBased + 
136
12  com.apple.CoreGraphics  0x908c8a77 create_generic_color_space + 
127
13  com.apple.CoreGraphics  0x908c8806 CGColorSpaceCreateWithIndex 
+ 298
14  com.apple.AppKit0x95f64a19 +[NSColorSpace
specialColorSpaceWithID:] + 193
15  com.apple.AppKit0x95f64950 +[NSColorSpace
genericRGBColorSpace] + 45
16  com.apple.AppKit0x95f64760 -[NSBitmapImageRep
_bitmapImageRep_setColorSpaceName:] + 55
17  com.apple.AppKit0x962327f5 -[NSBitmapImageRep
initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:]
+ 513
18  com.apple.AppKit0x95f641ee -[NSBitmapImageRep
_initWithSharedBitmap:rect:] + 302
19  com.apple.AppKit0x95f63e3c -[NSImage
_addRepresentationWithSharedKitWindow:rect:] + 224
20  com.apple.AppKit0x95f62c4c +[NSImage
_findSystemImageNamed:] + 274
21  com.apple.AppKit0x95f62992 +[NSImage imageNamed:] + 171
22  com.apple.AppKit0x95f62832 -[NSCustomResource
_loadImageWithName:] + 58
23  com.apple.AppKit0x95f62766 -[NSCustomResource
loadImageWithName:] + 49
24  com.apple.AppKit0x95f61ca3 -[NSCustomResource
awakeAfterUsingCoder:] + 365
25  com.apple.Foundation0x95bc420c _decodeObjectBinary + 2930
26  com.apple.Foundation0x95bc34e8 _decodeObject + 180
27  com.apple.AppKit0x95f614b3 -[NSMenuItem
initWithCoder:] + 1546
28  com.apple.Foundation0x95bc41f0 _decodeObjectBinary + 2902
29  com.apple.Foundation0x95bc34e8 _decodeObject + 180
30  com.apple.AppKit0x95f5cd63 -[NSNibConnector
initWithCoder:] + 395
31  com.apple.AppKit0x95f60dc0 -[NSNibControlConnector
initWithCoder:] + 865
32  com.apple.Foundation0x95bc41f0 _decodeObjectBinary + 2902
33  com.apple.Foundation0x95bc4ffc -[NSKeyedUnarchiver
_decodeArrayOfObjectsForKey:] + 1438
34  com.apple.Foundation0x95bc5669 -[NSArray(NSArray)
initWithCoder:] + 586
35  com.apple.Foundation0x95bc41f0 _decodeObjectBinary + 2902
36  com.apple.Foundation0x95bc34e8 _decodeObject + 180
37  com.apple.AppKit0x95f5be26 -[NSIBObjectData
initWithCoder:] + 2337
38  com.apple.Foundation0x95bc41f0 _decodeObjectBinary + 2902
39  com.apple.Foundation0x95bc34e8 _decodeObject + 180
40  com.apple.AppKit0x95f5b3f0 loadNib + 161
41  com.apple.AppKit0x95f5a848 +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] + 228
42  com.apple.AppKit0x95f5a759 +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] + 158
43  com.apple.AppKit0x95f5a6a4 +[NSBundle(NSNibLoading)
loadNibNamed:owner:

Crash after Fix

2009-12-16 Thread Gideon King
Hi all, I have a strange issue - I have a program that is running quite 
happily, and when I make a change to it and click the Fix button, it fixes the 
issue, but then I immediately get an exc_bad_access error when I continue 
running it. The stack trace shows a "doesNotRecognizeSelector" error. It always 
happens in the same place in my code, and the method does exist (it is in a 
category, and the method where it is being called from is in the same 
category). I have tried a complete clean and rebuild, but to no avail.

Any clue as to what may be causing this? It is really slowing down my debugging.

The code I am fixing is compiled into a framework which is included in the main 
application (my build target builds both the framework and the app) - could 
this be the cause? If so, is there something I need to do so that it works 
properly for debugging frameworks?

(gdb) bt
#0  0x94803a90 in strlen ()
#1  0x9480e400 in __vfprintf ()
#2  0x94820989 in asprintf ()
#3  0x9463d7ef in __CFExceptionProem ()
#4  0x9463d871 in -[NSObject(NSObject) doesNotRecognizeSelector:] ()
#5  0x94598db6 in ___forwarding___ ()
#6  0x94598982 in __forwarding_prep_0___ ()
#7  0x001101c7 in -[NMVisual(InternalLayout) textAreaSize] (self=0x613e90, 
_cmd=0x18114c) at 
/Users/gideon/Development/svn/trunk/mac/Source/NMVisual+InternalLayout.m:472


Thanks

Gideon___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [iPhone] Sample code for live camera stream?

2009-12-16 Thread Alex Kac
Actually the message in the forums specifically said when the new superceded 
function is released, you will be required to move to it. So that tells me it 
is going away.

As for where in the forums - go to the Quartz2D sub-forum and look for a 
subject with “Notice” I think.

On Dec 16, 2009, at 5:38 AM, Gabriel Zachmann wrote:

> 
>> Ah that's probably why the message in the forums says that it will be 
>> superceded in the future, for proper naming and hopefully slightly more 
>> functionality).
> 
> So there is at least some hope that this function won't got away ... that's 
> good news.
> 
> Could you please point me to the forum(s) where this was discussed?
> 
> Regards,
> Gabriel.
> 
> 
> ___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
> 
> This email sent to a...@webis.net

Alex Kac - President and Founder
Web Information Solutions, Inc.

"Patience is the companion of wisdom."
--Anonymous




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Warning about comparison between pointer and integer

2009-12-16 Thread Dave Carrigan

On Dec 16, 2009, at 8:18 AM, Eric E. Dolecki wrote:

> NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
> 
> alarm1_hour = [prefs integerForKey:@"alarm1Hour"];
> 
> if( alarm1_hour == NULL ){
> 
>  NSLog(@"alarm 1 hour is null" );
> 
> }

-integerForKey returns a NSInteger. Comparing NSInteger to NULL (which is a 
declared as a pointer) is going to give you that warning. It certainly makes 
not sense to compare an integer to NULL.

> Should I use a temporary variable to check instead of the variable with the
> pointer? Or are these warnings okay to ignore?

Warnings are almost never ok to ignore. The compiler is trying to tell you that 
you're probably doing something wrong.

-- 
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Warning about comparison between pointer and integer

2009-12-16 Thread Scott Ribe
> integerForKey

Returns an integer, not a pointer. See the docs.

If you want to check if the key exists, then objectForKey will return nil of
the key is not found.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Warning about comparison between pointer and integer

2009-12-16 Thread Eric E. Dolecki
Ah okay - thanks. I am now doing this:

if( [prefs objectForKey:@"alarm1Hour"] == nil ){

...

On Wed, Dec 16, 2009 at 11:33 AM, Scott Ribe wrote:

> > integerForKey
>
> Returns an integer, not a pointer. See the docs.
>
> If you want to check if the key exists, then objectForKey will return nil
> of
> the key is not found.
>
> --
> Scott Ribe
> scott_r...@killerbytes.com
> http://www.killerbytes.com/
> (303) 722-0567 voice
>
>
>


-- 
http://ericd.net
Interactive design and development
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Warning about comparison between pointer and integer

2009-12-16 Thread Fritz Anderson
On 16 Dec 2009, at 10:18 AM, Eric E. Dolecki wrote:

> I am using NSUserDefaults to store some data. On first run of the
> application, I check for the data, and if it's not been set already, I set
> it.

This is done, and better, by -[NSUserDefaults registerDefaults:].

> I however get warnings in my code. In my .h I set up my variables, and then
> in my .m:
> 
> NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
> alarm1_hour = [prefs integerForKey:@"alarm1Hour"];
> if( alarm1_hour == NULL ){
>  NSLog(@"alarm 1 hour is null" );
> }

You don't say, but I assume (hope) that alarm1_hour is declared as an integer. 
NULL is (at least notionally) declared as (void *)0; it's a pointer. Comparing 
them is almost always a mistake. Code written after 1988 or so should not treat 
integers and pointers as interchangeable.

Besides, -[NSUserDefaults integerForKey:] is documented (you read the 
documentation?) to return 0 if the key doesn't appear in the user defaults. 
Scalars (as in not-pointers) don't have "I'm not set" values (like NULL for 
pointers); every possible value may be meaningful. You may have "sentinel" 
values (valid, but you know to treat them as signals of a condition, rather 
than in-band values), but that's another story.

> Should I use a temporary variable to check instead of the variable with the
> pointer? Or are these warnings okay to ignore?

You don't ignore warnings, except on the most serious consideration, such as 
when the warning is about a condition that your code independently verifies 
cannot happen.

— F

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Warning about comparison between pointer and integer

2009-12-16 Thread jonat...@mugginsoft.com
> 
> Should I use a temporary variable to check instead of the variable with the
> pointer? Or are these warnings okay to ignore?

With regard to warnings I would recommend the following:

http://boredzo.org/blog/archives/2009-11-07/warnings
http://developer.apple.com/tools/xcode/compilercodewarnings.html

It takes a bit of time to comprehend all the subtleties involved but the 
payback is worth it.
Personally, I turn them on early and leave them on (this was learnt the hard 
way).

The static analyser is also supremely useful.

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Question in regards to .ics files

2009-12-16 Thread Eric E. Dolecki
I have been asked if my app can support reading an .ics file and base some
alarms, etc. from that. Aside from building my own "parser", are there
libraries out there that have been developed for dealing with .ics text
files? I am wishing that the format was XML-based, but is that naive?

Thanks,
Eric
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: pls explain rotated iPhone coordinates to me

2009-12-16 Thread Matt Neuburg
On or about 12/15/09 6:35 PM, thus spake "Luke the Hiesterman"
:

> It looks like this is a quirk of the transform not updating in time
> when launching in landscape mode. Feel free to file a bug.

Thanks so much! I think it's really a docs bug. Again I refer to this page:



The docs explicitly state that the three bullet points are *all* you need to
do. That's false. If the docs would add a warning to this effect, "Don't use
viewDidLoad on a view that rotates as it loads, because it's called before
the rotation occurs", that would have solved my issue. By postponing all
initialization until after the didRotate... call comes in, I'm now able to
use width as width and height as height! :) m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Jens Alfke
I'm implementing an outline view whose main column needs to show an icon next 
to the name, just like the Finder or Safari's bookmarks editor etc. etc. In the 
past I've always copied the handy ImageAndTextCell class from Apple's 
DragDropOutlineView sample, but I'm wondering if there is any cleaner way to do 
this nowadays without having to use a custom cell class. (This does have to 
remain 10.5-compatible, though.)

I dimly recall having heard of NSBrowserCell being used for this, but I don't 
remember any details.
Some apps use NSButtonCell, but it doesn't support editing the text and I need 
to do that.

—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Corbin Dunn
Use the ImageAndTextCell as an example, or some of the later updated ones:

http://developer.apple.com/Mac/library/samplecode/AnimatedTableView/index.html

particularly:

http://developer.apple.com/Mac/library/samplecode/AnimatedTableView/listing22.html

Don't use an NSButtonCell or an NSBrowserCell.

corbin

On Dec 16, 2009, at 9:47 AM, Jens Alfke wrote:

> I'm implementing an outline view whose main column needs to show an icon next 
> to the name, just like the Finder or Safari's bookmarks editor etc. etc. In 
> the past I've always copied the handy ImageAndTextCell class from Apple's 
> DragDropOutlineView sample, but I'm wondering if there is any cleaner way to 
> do this nowadays without having to use a custom cell class. (This does have 
> to remain 10.5-compatible, though.)
> 
> I dimly recall having heard of NSBrowserCell being used for this, but I don't 
> remember any details.
> Some apps use NSButtonCell, but it doesn't support editing the text and I 
> need to do that.

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


launching Application from terminal

2009-12-16 Thread Arun
Hi All

If i launch Applications from Terminal, using the command
/Applications/Calculator.app/Contents/MacOS/Calculator
The application is getting launched. But the Application widow will not be
the key window. Is there any way in which i can launch the application using
the same command and still make the Application window as key window?
I have tried making my sample application window as key window in
applicationDidFinishLaunching delegate but still failed.
Also the reason i am launching from Terminal is because i need to pass
command line parameters to My app

Thanks
Arun
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Cannot use malloc debug

2009-12-16 Thread Sean McBride
On 12/16/09 8:20 AM, Phi Le said:

>I can't run malloc debug. Even on a simple program (Xcode -> New
>Project -> Application -> Cocoa Application ), without any
>modification the default project.

That doesn't surprise me.  Although perhaps not officially, it is clear
to me that MallocDebug is dead.  Have you tried Instruments?  Also, this
would probably be better on the xcode list.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: launching Application from terminal

2009-12-16 Thread Joar Wingfors

On 16 dec 2009, at 10.06, Arun wrote:

> Also the reason i am launching from Terminal is because i need to pass
> command line parameters to My app


Do you really "need" to pass command line parameters to your app? That's not 
the usual way to pass configurations to GUI applications on Mac OS X. I 
wouldn't plan on shipping anything that depends on argument passing to a GUI 
app.

If you want to pass some command line arguments to your app for debugging 
purposes, you can set that up in your executable in Xcode (the "executable" is 
an Xcode concept where you declare how  you want to launch your product).

j o a r


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Jens Alfke

On Dec 16, 2009, at 10:05 AM, Corbin Dunn wrote:

> Use the ImageAndTextCell as an example, or some of the later updated ones:

Thanks!

Is there a bug filed to add such a cell to AppKit? It's such a common UI 
element in lists/outlines.

—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Corbin Dunn

On Dec 16, 2009, at 10:49 AM, Jens Alfke wrote:

> 
> On Dec 16, 2009, at 10:05 AM, Corbin Dunn wrote:
> 
>> Use the ImageAndTextCell as an example, or some of the later updated ones:
> 
> Thanks!
> 
> Is there a bug filed to add such a cell to AppKit? It's such a common UI 
> element in lists/outlines.

Yes, but other's don't hurt. 

-corbin

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


RE: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Lee Ann Rucker

> Don't use an NSButtonCell or an NSBrowserCell.

Just curious - why shouldn't we use an NSBrowserCell? Aside from it not being 
in an NSBrowser?___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [iPhone] Sample code for live camera stream?

2009-12-16 Thread Alex Kac
There is only one place that iPhone specific dev is *supposed* to be discussed 
on an Apple site. Cocoa-Dev is for general cocoa or Mac cocoa development. I 
use both depending on if its iPhone specific or Cocoa general. Here is the 
forum:

https://devforums.apple.com/community/iphone

The specific post is here:
https://devforums.apple.com/thread/34907?tstart=0

I don't know if I'm allowed to repost the contents so I'm just going to leave a 
link to the post.

On Dec 16, 2009, at 1:06 PM, Gabriel Zachmann wrote:

> Thanks for your response.
> I am, however, confused as to the "Quartz2D sub-forum" ... are you talking of 
> the mailing list Quartzcomposer-dev on lists.apple.com? But why do you call 
> it a "forum"?
> At any rate, I couldn't find a post with subject 'Notice' there ...
> 
> Regards,
> Gabriel.
> 
> 
>> Actually the message in the forums specifically said when the new superceded 
>> function is released, you will be required to move to it. So that tells me 
>> it is going away.
>> 
>> As for where in the forums - go to the Quartz2D sub-forum and look for a 
>> subject with “Notice” I think.
>> 
>> On Dec 16, 2009, at 5:38 AM, Gabriel Zachmann wrote:
>> 
>>> 
 Ah that's probably why the message in the forums says that it will be 
 superceded in the future, for proper naming and hopefully slightly more 
 functionality).
>>> 
>>> So there is at least some hope that this function won't got away ... that's 
>>> good news.
>>> 
>>> Could you please point me to the forum(s) where this was discussed?
>>> 
>>> Regards,
>>> Gabriel.
>>> 
>>> 
>>> ___
>>> 
>>> 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:
>>> http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
>>> 
>>> This email sent to a...@webis.net
>> 
>> Alex Kac - President and Founder
>> Web Information Solutions, Inc.
>> 
>> "Patience is the companion of wisdom."
>> --Anonymous
>> 
>> 
>> 
>> 
> 
> 
> Eigentlich bin ich ganz anders, nur komme ich so selten dazu.
>  ( Ödön von Horváth )
> 
>   http://zach.in.tu-clausthal.de
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

Alex Kac - President and Founder
Web Information Solutions, Inc.

"I am not young enough to know everything."
--Oscar Wilde




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Corbin Dunn

On Dec 16, 2009, at 10:51 AM, Lee Ann Rucker wrote:

> 
>> Don't use an NSButtonCell or an NSBrowserCell.
> 
> Just curious - why shouldn't we use an NSBrowserCell? Aside from it not being 
> in an NSBrowser?___

I think you answered your own question. But...

1. It is really made to work in NSBrowser
2. Many properties only pertain to NSBrowser (ie: isLeaf)
3. There is no ivar storage for the image (it is implemented as a side hash 
table). This isn't necessarily a bad thing.
4. It doesn't descend from NSTextFieldCell, which provides some more editing 
features not found on NSBrowserCell.

Still, having said that, it will work to use it in an NSTableView (the 
open/save panel does this, for example). I just don't recommend doing it. 

-corbin

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Question about touchesBegan

2009-12-16 Thread Benjamin Stiglitz
> I'll elaborate a little more. I have a main view with some source buttons
> (UIButton) at the top. When I click one, I bring up a radio style tuner bar
> in a subview (animates up from the bottom). I am using touches to move the
> "pointer" in that subView. Works great, however because the subView is
> detecting touches for the whole subView - it prevents touches on those
> buttons in the main view. Do I simply need to architect this in another way?
> Say create a subview of just the UIButtons at the top of all subViews?

That would work. You could also override -hitTest:withEvent:.

-Ben
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: launching Application from terminal

2009-12-16 Thread Jens Alfke


On Dec 16, 2009, at 10:06 AM, Arun wrote:


If i launch Applications from Terminal, using the command
/Applications/Calculator.app/Contents/MacOS/Calculator
The application is getting launched. But the Application widow will  
not be
the key window. Is there any way in which i can launch the  
application using

the same command and still make the Application window as key window?


That's because Terminal hasn't relinquished its frontmost status, and  
a newly launched app won't come to the front unless it's been  
relinquished.


You could call [NSApp activateIgnoringOtherApps: YES] in your app when  
it launches, but that's kind of rude.


But I agree with the others that passing command-line parameters to a  
GUI app is a pretty odd thing to do; you should rethink it unless you  
have some really strong reason to do it (like, this app is a developer  
tool that will mostly be invoked from the command line.)


—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Jens Alfke


On Dec 16, 2009, at 10:05 AM, Corbin Dunn wrote:

Use the ImageAndTextCell as an example, or some of the later updated  
ones:

http://developer.apple.com/Mac/library/samplecode/AnimatedTableView/index.html


I looked at ATImageTextCell, but it does things I don't need (fill  
color) and has dependencies on a bunch of other classes from that  
sample. I'll stick with ImageAndTextCell since it's simpler and  
standalone.


—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: launching Application from terminal

2009-12-16 Thread Jerry Krinock

On 2009 Dec 16, at 10:06, Arun wrote:

> If i launch Applications from Terminal, using the command
> /Applications/Calculator.app/Contents/MacOS/Calculator
> The application is getting launched. But...

not very well, as you and others have noted.

If you want a *supported* way to do this, see man page for /usr/bin/open.  It 
allows you to pass arguments.

As noted, this is hacky.  AppleScriptability would be 
better.___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Benjamin Stiglitz
> I looked at ATImageTextCell, but it does things I don't need (fill color) and 
> has dependencies on a bunch of other classes from that sample. I'll stick 
> with ImageAndTextCell since it's simpler and standalone.

The old ImageAndTextCell doesn’t handle the background style, and that alone 
makes a modified version of the ATImageTextCell worth using.

-Ben___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSUndoManager auto-grouping?

2009-12-16 Thread Kyle Sluder
On Wed, Dec 16, 2009 at 12:13 PM, Scott Squires  wrote:
> First off, for whatever reason my question had been held on to by the
> moderator.  After a few days of no response I re-submitted.
> What you're seeing I can only assume is the release of those emails
> unbeknownst to me.

Too bad Cocoabuilder is down, it was very useful for confirming that
messages have gotten through.

> And yes, I did read the documentation on the UndoManager.  And I have done
> pre/post the thread with similar results.  I'm trying to make sure they are
> both in sync and non-grouped.

There is no such thing as a non-grouped undo event.

> Is there a clean method (which I take it is the group method) to make sure
> that undo functions aren't automatically grouped based on event cycles?  Is
> there a recommended way of dealing with UI and async actions relative to the
> undomanager?

The first thing you need to do is sit down and rigorously specify the
behavior you want. I think that if you try that you will see that
there is no correct way to reconcile "asynchronous" and "undo." There
is certainly no way to use it from multiple threads.

Only when you have a spec in hand can you possibly approach this task
in any sane way.

> You imply that there are undomanager issues.  Are there known ones I and
> others should be aware of?

Search the list archives, specifically for recent messages from Graham
Cox, who has written his own undo manager replacement to avoid some
pitfalls in NSUndoManager.

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Managed Object with Transformable Attribute (C Struct)

2009-12-16 Thread Melissa J. Turner

On Dec 15, 2009, at 20:47, Richard Somers wrote:

> On Dec 15, 2009, at 9:18 PM, Graham Cox wrote:
> 
>> You're archiving 'value'. You want instead to return the mutableData that 
>> the first archiver wrote to, which is otherwise unused.
> 
> Thanks. Saving keyed archive of struct foo now works for xml store (I think, 
> when I open up the xml document I was expecting to see the keys for foo but 
> instead just see data as before).
> 
> Prior to this change document saved ok in xml and sqlite but save as binary 
> resulted in error: *** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this 
> archiver cannot encode structs.
> 
> With this change saving to xml is ok but saving as sqlite or binary results 
> in error: The document could not be saved as "document".foo is a required 
> value.
> 
> My whole application works fine with core data, bindings, saving to different 
> store types, etc. Just this one attribute is causing problems.
> 
> Any ideas?
> 

I think you're running into a known problem with the binary store not 
respecting the value transformer name and instead always using the default 
archiver (NSKeyedArchiver).

The only real workaround is to have a wrapper property (ie a property returning 
an NSData) that does the transform and persist that instead.

+Melissa


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Core Video - Getting Started

2009-12-16 Thread Travis Kirton
Hi,

I'm planning a project where I'll be running somewhere between 15 and 20 videos 
on screen, any number of them could be playing at the same time (not 
necessarily in sync).

I got an example running with Core Animation and Layers using very little code, 
actually adapted from: 
http://www.cimgf.com/2008/09/10/core-animation-tutorial-rendering-quicktime-movies-in-a-caopengllayer/

But, the final intention would be to have a bunch of videos moving around on 
screen. So, I thought it would be better to build this using the Core Video 
frameworks.

I am looking through the CoreVideo(101,102,103...) example projects now.

I'm wondering if anyone can confirm that I should be going in this direction or 
not?

Thanks,
T___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Managed Object with Transformable Attribute (C Struct)

2009-12-16 Thread Rob Keniger

On 17/12/2009, at 9:39 AM, Melissa J. Turner wrote:

> I think you're running into a known problem with the binary store not 
> respecting the value transformer name and instead always using the default 
> archiver (NSKeyedArchiver).


AHA! I didn't realise that this was a known bug, I've had a question open on 
stackoverflow for about a month on this one:

http://stackoverflow.com/questions/1598600/

I thought it was just me being dense. Thanks for the info.

--
Rob Keniger



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Crash after Fix

2009-12-16 Thread Rob Keniger

On 17/12/2009, at 2:27 AM, Gideon King wrote:

> Hi all, I have a strange issue - I have a program that is running quite 
> happily, and when I make a change to it and click the Fix button, it fixes 
> the issue, but then I immediately get an exc_bad_access error when I continue 
> running it. The stack trace shows a "doesNotRecognizeSelector" error. It 
> always happens in the same place in my code, and the method does exist (it is 
> in a category, and the method where it is being called from is in the same 
> category). I have tried a complete clean and rebuild, but to no avail.


In my experience, "Fix and Continue" is unreliable at best. I never use it.

--
Rob Keniger



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Graham Cox

On 17/12/2009, at 8:27 AM, Jens Alfke wrote:

> I looked at ATImageTextCell, but it does things I don't need (fill color) and 
> has dependencies on a bunch of other classes from that sample. I'll stick 
> with ImageAndTextCell since it's simpler and standalone.


I found ImageAndTextCell in Apple's sample code a bit useless, though I forget 
now what the problems were I had with it. It's possible I got hold of an old 
version too. But anyhoo, I wrote a simple replacement that I used for showing a 
folder next to the name in an outline view, and it's part of this little 
project here:

http://apptree.net/gcfolderbrowser.htm

If it works for you, feel free to use it.

--Graham


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: App works when launched from Xcode, not from Finder

2009-12-16 Thread PCWiz
I've sent Joar the source off list, but meanwhile I tried Kyle Sluder's 
suggestion to run gdb on the app. Here's the log:

pcwiz-mbp:~ Indragie$ gdb 
/Users/pcwiz/Desktop/TwitMenu/build/Release/TwitMenu.app 
GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul  3 01:19:56 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared 
libraries .. done

(gdb) set env MallocStackLogging 1
(gdb) set env NSDebugEnabled 1
(gdb) set env NSZombieEnabled 1
(gdb) fb -[NSException raise]
Breakpoint 1 at 0xb43958105b0a14
(gdb) fb objc_exception_throw
Breakpoint 2 at 0xa3d70a3d6570da
(gdb) r
Starting program: 
/Users/pcwiz/Desktop/TwitMenu/build/Release/TwitMenu.app/Contents/MacOS/TwitMenu
 
bash(6349) malloc: recording malloc stacks to disk using standard recorder
bash(6349) malloc: stack logs being written into 
/tmp/stack-logs.6349.bash.SGcY1m.index
arch(6349) malloc: recording malloc stacks to disk using standard recorder
arch(6349) malloc: stack logs deleted from 
/tmp/stack-logs.6349.bash.SGcY1m.index
arch(6349) malloc: stack logs being written into 
/tmp/stack-logs.6349.arch.KsKogQ.index
Reading symbols for shared libraries 
.+++.++..
 done
TwitMenu(6349) malloc: recording malloc stacks to disk using standard recorder
TwitMenu(6349) malloc: stack logs deleted from 
/tmp/stack-logs.6349.arch.KsKogQ.index
TwitMenu(6349) malloc: stack logs being written into 
/tmp/stack-logs.6349.TwitMenu.3f3GYp.index
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

And that's about it (unless I'm using gdb wrong). In the app itself I get an 
authorization failed error. And if I launch the executable directly using 
Terminal, this is all it logs (as I mentioned previously):

2009-12-16 19:00:22.166 TwitMenu[6440:903] fail: 'Error Domain=NSURLErrorDomain 
Code=-1012 UserInfo=0x20059db00 "The operation couldn’t be completed. 
(NSURLErrorDomain error -1012.)" Underlying Error=(Error 
Domain=kCFErrorDomainCFNetwork Code=-1012 UserInfo=0x200444ba0 "The operation 
couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)")'

I don't know what this error is or what it means. What I do know is that the 
exact same code, in Debug mode, or even in Release (when launched from Xcode) 
works fine. Is it possible that this is a bug with NSURLConnection?

On 2009-12-16, at 8:08 AM, Joar Wingfors wrote:

> 
> On 16 dec 2009, at 07.04, PCWiz wrote:
> 
>> This is making absolutely 0 sense to me, and right now it seems like its a 
>> screwup on Xcode's part. I can privately email the source if necessary (its 
>> a commercial app, but right now I'm willing to do anything to get this 
>> fixed).
> 
> 
> That doesn't make any sense to me either. I doubt that the launching of two 
> copies is Xcode's fault though.
> 
> Zip up your source and send it to me, and I'll take a look.
> 
> j o a r
> 
> 

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Reg: Image editing using iPhone SDK

2009-12-16 Thread Matthew Lindfield Seager
On Wednesday, December 16, 2009, Sravanthi
 wrote:
> Is it possible to do image editing...  ...using iPhone SDK?

Yes.

What have you tried? (http://WhatHaveYouTried.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Lack of Manpower May Kill VLC For Mac

2009-12-16 Thread Adam Gerson
"The Video Lan dev team has recently come forward with a notice that
the number of active developers for the project's MacOS X releases has
dropped to zero, prompting a halt in the release schedule. There is
now a disturbing possibility that support for Mac will be dropped as
of 1.1.0. As the most versatile and user-friendly solution for
bridging the video compatibility gap between OS X and windows, this
will be a terrible loss for the mac community. There is still hope,
however, if the right volunteers come forward."

http://apple.slashdot.org/story/09/12/16/2145251/Lack-of-Manpower-May-Kill-VLC-For-Mac

http://forum.videolan.org/viewtopic.php?f=12&t=59905#p228791
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Modifying outside properties from NSOperation subclass

2009-12-16 Thread Jens Alfke

On Dec 14, 2009, at 7:59 PM, PCWiz wrote:

> "doResourceHungryTask" would be a method in my delegate class. Would I still 
> need to lock/unlock (I'm modifying the class's properties from itself, not 
> another class)? I'm not sure on the exact workings of NSInvocationOperation, 
> I just found out about it.

I would suggest you either take a break and read some overview material on 
concurrency and threading; or avoid touching any external data from within an 
active NSOperation. If you try to write concurrent code without having a solid 
understanding of what you're doing, the results are going to be horrible. There 
is nothing in computer science as frustrating to debug as broken multithreaded 
code. :-/

—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: ImageAndTextCell still the way to go for icons in outline views?

2009-12-16 Thread Jens Alfke

On Dec 16, 2009, at 1:40 PM, Benjamin Stiglitz wrote:

> The old ImageAndTextCell doesn’t handle the background style, and that alone 
> makes a modified version of the ATImageTextCell worth using.

What do you mean by 'the background style'? I don't need the cell to draw a 
background at all; it's in an outline view.

BTW, there is a crashing bug in the current version of ImageAndTextCell as 
found in DragNDropOutlineView. The 'image' property is declared as assign when 
it should be retain. Unfortunately the dealloc method still releases the image, 
so when the cell goes away whatever image it last had is toast. :( I filed a 
comment on the doc feedback form.

—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: App works when launched from Xcode, not from Finder

2009-12-16 Thread Jens Alfke

On Dec 15, 2009, at 8:05 PM, PCWiz wrote:

> *** -[NSRecursiveLock unlock]: lock ( '(null)') 
> unlocked from thread which did not lock it
> *** Break on _NSLockError() to debug.
> *** -[NSRecursiveLock finalize]: lock ( '(null)') 
> finalized while still in use
> *** Break on _NSLockError() to debug.
> 
> I've gotten these before, and they don't seem to affect the operation of the 
> app so I doubt this is what's causing my problem

They're almost certain to cause other problems though, probably in an 
intermittent and difficult-to-reproduce way. This is a sign that something is 
seriously wrong with the way you're using locks. See my previous post ... locks 
are like guns, you definitely don't want to mess around with them without 
having been trained in how to use them safely.

—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Command+Option+Return not sent to doCommandBySelector:

2009-12-16 Thread Gideon King
Hi

I have a custom view that implements the NSTextInputClient protocol, and it 
successfully receives doCommandBySelector: method calls for just about every 
other non-text entry key combination, but Command+Option+Return just doesn't 
get there (or to anything else in the NSTextInputClient protocol).

As an experiment, I implemented every action method I saw in the NSResponder 
class, in case it had been interpreted by something else which was just 
swallowing it, but none of those methods was being called for this key 
combination.

Obviously I can pick it up in keyDown: if necessary, but I had hoped to not 
need to do that...

Anybody know how I can get Command+Option+Return to call doCommandBySelector: 
as all the other keystrokes do?

Thanks

Gideon


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSPredicate Matches

2009-12-16 Thread Gerriet M. Denkmann

I have a Core Date entity A which has a to-many ralationship called theBs.
And a Core Date entity B which has a to-many ralationship called theCs.
And a final Core Date entity C which has an NSString attribute called 
someString.

I tried to find all A entities which contain "xyz" by using an NSPredicate: 
"ANY theBs.theCs.someString MATCHES ".*xyz.*" "

But all I got was an error message:
Can't do regex matching on object [description of an NSSet with all the 
someStrings connected to the first A entity].

When I change the predicate to: "ANY theBs.theCs.someString CONTAINS  "xyz" " 
it kind of works, but for xyz = "change the" I get no finds, whereas for xyz = 
"change the price" the predicate finds one entity (correct), and for xyz = 
"change the p" it finds nothing again.

So CONTAINS is not really usable for me.

Any insight would be much appreciated.

Kind regards,

Gerriet.

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: App works when launched from Xcode, not from Finder

2009-12-16 Thread PCWiz
I'm not using NSLock or NSRecursiveLock directly. I'm using  
@synchronized on an object that multiple threads acess, to allow only  
one thread to access the object at a time.


That said, I only ever got those errors once but in any case I've set  
a breakpoint for _NSLockError to trap it next time. But I wonder, how  
would using @synchronized create these issues? The use of  
@synchronized seems relatively simple, but maybe I'm missing something  
here.


On 2009-12-16, at 9:07 PM, Jens Alfke  wrote:



On Dec 15, 2009, at 8:05 PM, PCWiz wrote:

*** -[NSRecursiveLock unlock]: lock (  
'(null)') unlocked from thread which did not lock it

*** Break on _NSLockError() to debug.
*** -[NSRecursiveLock finalize]: lock (  
'(null)') finalized while still in use

*** Break on _NSLockError() to debug.

I've gotten these before, and they don't seem to affect the  
operation of the app so I doubt this is what's causing my problem


They're almost certain to cause other problems though, probably in  
an intermittent and difficult-to-reproduce way. This is a sign that  
something is seriously wrong with the way you're using locks. See my  
previous post ... locks are like guns, you definitely don't want to  
mess around with them without having been trained in how to use them  
safely.


—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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Drawing into myView

2009-12-16 Thread R T
I have a subclass of NSView and I want to draw into it after I retrieve an 
Image in an NSImageView.

I'm trying to set 2 instance variables in the drawRect block of code...

@property(readwrite) NSRect tRect;
@property (retain, readwrite) NSGraphicsContext*savedContext;
___

- (void)drawRect:(NSRect)rect
{
[selfsetSavedContext:[NSGraphicsContext currentContext]];
[selfsetTRect:rect];
}

...and then in a block of code called when the NSImageView has an image dragged 
into it, 
I try to draw a black background into the view. Nothing is drawn and I don't 
seem to have any context.

- (void) process{
[NSGraphicsContext setCurrentContext:savedContext];
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];

//
CGRect aRect = NSRectToCGRect(tRect);
CGLayerRefbkgndLayer = CGLayerCreateWithContext (context, aRect.size, NULL);
CGContextRefbkgndContext = CGLayerGetContext (bkgndLayer); 
CGContextSetRGBFillColor (bkgndContext, 0, 0, 0, 1);
CGContextFillRect (bkgndContext, aRect);
CGContextSaveGState(context);
CGContextDrawLayerInRect (context, aRect, bkgndLayer); 
CGContextRestoreGState(context);
CGLayerRelease(bkgndLayer);
//
}

Any help greatly appreciated, 
Thanks, Rick



  
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


core data: Entity vs Class mode

2009-12-16 Thread Rainer Standke

Hello,

in core data how does it make a difference whether an ObjectController  
is in Entity or Class Mode?


Thanks,

Rainer
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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