Debugging a self made Framework

2010-10-25 Thread Frank Gregor
Hello,

after hours of searching the web & reading the docs, however I'm unable to 
debug my framework. I've builded it with "Debug" config and added this builded 
framework to my project. When I start debugging my project, setting a 
breakpoint at an object from a class declared in the framework a "Step into 
method" don't work. It always steps over...

Can someone give me a hint or link please, where it is described in detail how 
to debug such a constellation?
Thanks a lot,
phranck








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

[ANN] Houston iPhone dev meetup Tuesday 10/26

2010-10-25 Thread Joao Prado Maia
Hello,

We have an Houston iPhone development meetup happening next Tuesday (10/26) at 
6:30pm. We currently have 28 people RSVP'ed to the event, and would love to get 
more developers involved. It's free to attend our meetings 

Darren Stokes will be presenting an introduction to using Core Data on iOS. The 
overview will include using the modeling tool, manipulating objects, writing 
queries, faulted objects, usage of the NSFetchedResultsController, and tips and 
tricks to help you get started.

We will also have our usual App Showcase session at the end of meeting, so if 
you are interested in presenting here (10-15 minutes each) get in touch with me.

Feel free to bring in any questions, bugs or any other topics to be discussed. 
We usually start at around 6:30pm with introductions between everyone 
attending, and the presentation starts at 7pm.

TUESDAY, Oct 26
6:30pm - 9:00pm

More details can be found here:
http://www.meetup.com/Houston-iPhone-Developers-Meetup/calendar/14686334/

Hope to see some of you there!

--Joao___

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


NSDrawer contentView clip

2010-10-25 Thread gMail.com
I have put some buttons within a drawer.contentView
The top most button gets cut by 20 pixels because the contentView result
shorter than its superview height. So, at the top of the drawer I always see
a gray rectangle, 20 pixels height, where I can't draw in.
Please, how can I use the whole height of the drawer height?

I unsuccessfully tried to subclass the contentView and return different
frame and bounds values, also returning bigger values with
drawerWillResizeContents but, no way. It seems that the contentView gets
clipped by its superview. Any solution?


Best Regards
-- 
Leo


___

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


Debugging a self made Framework

2010-10-25 Thread Frank Gregor
Hello,

after hours of searching the web & reading the docs, however I'm unable to 
debug my framework. I've builded it with "Debug" config and added this builded 
framework to my project. When I start debugging my project, setting a 
breakpoint at an object from a class declared in the framework a "Step into 
method" don't work. It always steps over...

Can someone give me a hint or link please, where it is described in detail how 
to debug such a constellation?
Thanks a lot,
phranck___

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: Debugging a self made Framework

2010-10-25 Thread Jerry Krinock

On 2010 Oct 24, at 08:56, Frank Gregor wrote:

> When I start debugging my project, setting a breakpoint at an object from a 
> class declared in the framework a "Step into method" don't work. It always 
> steps over...
> 
> Can someone give me a hint

You've posted to (and possibly searched) the wrong email list.  On 
xcode-us...@lists.apple.com, this has been discussed as a known issue in Xcode 
3.2.2.  I found it to be fixed in 3.2.3, but then someone disagreed.


___

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: NSError help

2010-10-25 Thread Tom Jones
Thanks,
Yes, the compiler was complaining about the "*err = *localErr;". I origionally 
had it to be "*err = localErr;" but I was still getting a EXC_BAD_ACCESS error. 
But then the light bulb went off :-)when I read "he isn't checking for nil 
err", and that is exactly what was my problem.

I changed the code a bit per your suggestions. 

return [self getDataForType:aType separator:@"\t" excludeFields:nil error:err];

But the other change I had to make was 

if(err) {
NSMutableDictionary *errorDetail = [NSMutableDictionary dictionary];
[errorDetail setValue:@"Failed to find the requested type." 
forKey:NSLocalizedDescriptionKey];
*err = [NSError errorWithDomain:@"DataForType" code:1 userInfo:errorDetail];
}

return nil;

Thanks for the help,
tom

- Original Message -
From: "Ken Thomases" 
To: "Tom Jones" 
Cc: cocoa-dev@lists.apple.com
Sent: Sunday, October 24, 2010 4:05:19 PM
Subject: Re: NSError help

On Oct 24, 2010, at 5:54 PM, Tom Jones wrote:

> I'm trying to understand why I'm getting thrown in to the debugger when using 
> NSError. I have three methods and I'm overloading them and trying to pass the 
> NSError along the way. What am I doing wrong?

> -(NSString *)getDataForType:(NSString *)aType error:(NSError **)err
> {
>NSError *localErr = nil;
>NSString *result = [self getDataForType:aType separator:@"\t" 
> excludeFields:nil error:&localErr];  
>*err = *localErr;

This is incorrect.  The left and right sides are of two different types.  The 
compiler should have at least warned, if not given an error.

"*localErr" is an NSError.  It's not an NSError* (pointer to NSError), it's 
actually the type of the object (or struct).  There's almost never a case to 
dereference an object pointer like this.

"*err" is an NSError*, a pointer to an NSError.

What you wanted is:

*err = localErr;

Actually, if you're not doing more with localErr, you can just eliminate it and 
just do:

   NSString *result = [self getDataForType:aType separator:@"\t" 
excludeFields:nil error:err];

The same mistake affects the next method, too.

>return result;
> }

Regards,
Ken

___

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


Drag and drop between 2 table views

2010-10-25 Thread Paul Johnson
I have two table views and I want to drag and drop from one to the other.


I'm using Core Data and Bindings, and the


I'm able to select items in the source table and I'm copying an index set
listing indexes of the selected items to the pasteboard.


I haven't been able to drop the selected items on the destination table
view.


I have two array controllers, one for each table view.


What is the correct way for the destination array controller to access an
item in the source table view?
___

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


HTTPS problem

2010-10-25 Thread Artem
My app is communicating to several secured servers (SSL). One of those 
working with created by me self-signed certificate. Problem is when app 
is tries to connect to that server with:


- 
(void)continueWithoutCredentialForAuthenticationChallenge:(NSURLAuthenticationChallenge 
*)challenge;(1)


which is called from

- (void)connection:(NSURLConnection*)theConnection 
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge*)theChallenge;   
(2)


method it uses built-in anchor certificates, but connection fails (as 
expected), then it tries to do that with my cert and fails again because 
session was cached. App thinks that if that server isn't trusted than it 
doesn't need any checks again. And method (2) not even called.


So how can I reset the session or something like that to make it works?
___

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


Audio Streaming with Cocoa

2010-10-25 Thread Bilel Mhedhbi
Hi everybody,
I want to practice and make my own radio player with Cocoa. I just want to know 
what are your ideas about how to get an audio stream across the internet (I 
already did something, but I want to know your ideas before I show it to you).

Best Regards,
B. Mhedhbi___

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: [NSImage] Bug in System Preferences? [solved]

2010-10-25 Thread Iceberg-Dev


On Oct 23, 2010, at 2:41 AM, Ken Ferry wrote:

On Oct 22, 2010, at 4:07 PM, Iceberg-Dev   
wrote:



On Oct 22, 2010, at 12:48 AM, Iceberg-Dev wrote:


I'm currently playing with a screen saver.

Problem:


It draws correctly in fullscreen mode or in SaverLab but does not  
in the preview mode of the 'Desktop & Screen Saver' pane of the  
System Preferences.


Basically, in #fail mode, it draws the first frame and then does  
not refresh.


It works on Mac OS X 10.4 but does not on Mac OS X 10.5 and 10.6.


[...]


QUESTION:
-

What can be done to address this behavioral incoherence in System  
Preferences?


I solved the issue on Mac OS X 10.6 by calling  
lockFocusOnRepresentation: and unlockFocus before and after I  
refresh the bitmap buffer.


Funnily enough, this bug also exists with the CoreGraphics API.


Hi-

This isn't a bug, and your workaround could break under you at any  
time.


If you think about what has to happen, you'll realize you cannot  
just have permanent direct access to the backing store. The image  
has to be colormatched and possibly uploaded to the graphics card,  
for example. How are the frameworks to know if you toggled a bit  
and that work must be redone? The basic CG model for an image is  
that it's immutable.


Thanks for the hints. I tried them this weekend.

When working with NSBitmapImageRep, calling -bitmapData is a signal  
that you may be editing the data. It is not repackaged until the  
bitmap is drawn, or somesuch. It's illegal to just stash a pointer  
to the data and use it arbitrarily later - that won't necessarily  
be the same data as now backs the image. This is described in the  
10.6 AppKit release notes.


Calling -bitmapData works on Mac OS X 10.5, it does not work on Mac  
OS X 10.6. On 10.6, it's slow and the data gets zeroed. Bug?


In CG, you may be interested in the relationship of CGBitmapContext  
to CGBitmapContextCreateImage. The latter makes a copy-on-write vm  
copy of the data from bitmap context. So it's cheap until real  
copying is forced by a write to the context data.


I tried this solution and it's way too slow (or I'm doing it  
incorrectly). Having to create a CGImageRef and then releasing it is  
killing the framerate.



Basically, the only solution to get a decent framerate (25 fps) and a  
real refresh is to:


- call -bitmapData on Mac OS X 10.5.

- call lockFocusOnRepresentation: on Mac OS X 10.6.


___

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


Thread not registered mystery under GC

2010-10-25 Thread Andy O'Meara

Hey guys, hopefully someone who knows what may be going under the 
pthread/NSThread hood when GC is enabled can solve this little mystery...

Pretty straightforward situation: I have a 64 bit Cocoa app (and screen saver) 
that uses pthreads (via the pthread API, *not* NSThread).  To be compatible 
with GC with IAW with Apple's GC Programming Guide (quote below), I make a call 
to [NSThread currentThread] when a new thread starts so that it gets registered 
with the GC subsystem.  

Per Apple GC Programming Guide (page 15):

// SNIP //

Garbage collection is performed on its own thread--a thread is explicitly 
registered with the collector if it calls NSThread's currentThread method (or 
if it uses an autorelease pool). There is no other explicit API for registering 
a pthread with the collector.

// SNIP //

However when my bundle runs under as a 64 bit GC app or a 64 bit screen saver 
(via the sys prefs app), the following log msg shows up for each call to 
[NSThread currentThread] I make when the thread first starts:

[0x0-0x8b08b0].com.apple.systempreferences[1198]System 
Preferences(1198,0x11a8f9000) malloc: *** auto malloc[1198]: error: GC 
operation on unregistered thread. Thread registered implicitly. Break on 
auto_zone_thread_registration_error() to debug.

As the message directs, I set that breakpoint, and I see the following stack 
inside of the [NSThread currentThread] call:

#0  0x7fff81b08c64 in auto_zone_thread_registration_error
#1  0x7fff81b089aa in Auto::Zone::registered_thread
#2  0x7fff81b01df0 in auto_zone_allocate_object
#3  0x7fff85c8602a in _internal_class_createInstanceFromZone
#4  0x7fff866d56e9 in +[NSObject(NSObject) allocWithZone:]
#5  0x7fff866d5671 in +[NSObject(NSObject) new]
#6  0x7fff88e553b5 in _NSThreadGet0

So, it seems like I'm following the spec yet I can't seem to shake that error 
message.  Anyone on the inside care to illuminate what's happening here?  Apart 
from those [NSThread currentThread] calls I make when the pthread first starts, 
is there something else I need to call that the GC spec doesn't discuss?

Thanks in advance!

Andy




___

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


Drag and drop between two table views.

2010-10-25 Thread Paul Johnson
I am trying to drag and drop from one text view to another. I can write an
index set of copied rows to the pasteboard using:


- (BOOL)tableView:(NSTableView *)tv

writeRowsWithIndexes:(NSIndexSet *)rowIndexes

toPasteboard:(NSPasteboard*)pboard {

  // Copy the row numbers to the pasteboard.

  NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];

  [pboard declareTypes:[NSArray arrayWithObject:NSDragPboard] owner:self];

  [pboard setData:data forType:NSDragPboard];

  return YES;

}


In the array controller for the destination text view, I have


- (BOOL)tableView:(NSTableView *)aTableView

   acceptDrop:(id )info

  row:(NSInteger)row

dropOperation:(NSTableViewDropOperation)operation

{

  NSPasteboard* pboard = [info draggingPasteboard];

  NSData* rowData = [pboard dataForType:NSDragPboard];

  NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData
:rowData];

  NSInteger dragRow = [rowIndexes firstIndex];



  // Move the specified row to its new location...

  NSLog(@"count = %i", [rowIndexes count]);

  while(dragRow != NSNotFound)

  {

NSLog(@" %i", dragRow);

dragRow = [rowIndexes indexGreaterThanIndex:dragRow];

//  Copy a row here. 

  }

  return YES;

}


I'm having trouble figuring out the correct code in the while-loop where I
need to copy a row.


As you can see, I'm new at this, but perhaps someone can lead me in the
right direction. Thanks.
___

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


Move UINavigationBar down?

2010-10-25 Thread Stephen Zyszkiewicz
I'm trying to position the navigation bar below the top of the screen.

I've tried the following in viewWillAppear:

self.navigationController.view.frame = CGRectMake(0.0, 54.0, 320.0, 426.0);
self.navigationController.navigationBar.frame = CGRectMake(0.0, 0.0, 320.0, 
44.0);

The problem is it only seems to work the very first time the view is displayed. 
If you go to another tab, and back, the navigation bar is at the top of the 
screen. This also happens when the iPhone is rotated.

Should I be trying to adjust the navigation controller frame, or should I 
instead try to add the navigation controller to another view that is below the 
top of the screen?


Thanks,
Steve___

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: Thread not registered mystery under GC

2010-10-25 Thread Bill Bumgarner

On Oct 25, 2010, at 2:22 PM, Andy O'Meara wrote:

> Per Apple GC Programming Guide (page 15):
> 
> // SNIP //
> 
> Garbage collection is performed on its own thread--a thread is explicitly 
> registered with the collector if it calls NSThread's currentThread method (or 
> if it uses an autorelease pool). There is no other explicit API for 
> registering a pthread with the collector.
> 
> // SNIP //

That'd be a bug;  please file via http://bugreport.apple.com/ and provide an 
URL to the document.

> However when my bundle runs under as a 64 bit GC app or a 64 bit screen saver 
> (via the sys prefs app), the following log msg shows up for each call to 
> [NSThread currentThread] I make when the thread first starts:
> 
> [0x0-0x8b08b0].com.apple.systempreferences[1198]  System 
> Preferences(1198,0x11a8f9000) malloc: *** auto malloc[1198]: error: GC 
> operation on unregistered thread. Thread registered implicitly. Break on 
> auto_zone_thread_registration_error() to debug.
> 
> As the message directs, I set that breakpoint, and I see the following stack 
> inside of the [NSThread currentThread] call:
> 
> #00x7fff81b08c64 in auto_zone_thread_registration_error
> #10x7fff81b089aa in Auto::Zone::registered_thread
> #20x7fff81b01df0 in auto_zone_allocate_object
> #30x7fff85c8602a in _internal_class_createInstanceFromZone
> #40x7fff866d56e9 in +[NSObject(NSObject) allocWithZone:]
> #50x7fff866d5671 in +[NSObject(NSObject) new]
> #60x7fff88e553b5 in _NSThreadGet0
> 
> So, it seems like I'm following the spec yet I can't seem to shake that error 
> message.  Anyone on the inside care to illuminate what's happening here?  
> Apart from those [NSThread currentThread] calls I make when the pthread first 
> starts, is there something else I need to call that the GC spec doesn't 
> discuss?

Yes.  Call objc_registerThreadWithCollector() from the thread.

The behavior was changed because folks were surprised to see the collector 
being registered on their thread when they were "only" using Core Foundation 
code and "no Objective-C".   Core Foundation is actually implemented using a 
growing chunk of Objective-C code.   Thus, the collector became noisy about 
this so people wouldn't be surprised -- or, more importantly, would be 
surprised but would figure out what is up more quickly.

That document is wrong.

b.bum
___

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


Few binaries in one application's Bundle

2010-10-25 Thread eveningnick eveningnick
Hello
My project consists of few binaries, and i wanted to put them into one
application Bundle (thus, i placed them into ./Contents/MacOS/).
Only one of these binaries is launched when the bundle is
doubleclicked in finder (i have specified it in ExecutableFile in
bundle's Info.plist file). Other binary files - one is an agent that
is started with launchd, and one auxilary GUI application (that is
launched either by the agent, or by main binary).

The problem is, when either one of binaries is started, no one else
from this bundle can be launched. The bundle itself is
"LSUIElement=TRUE".
I was wondering, if i could use some technique/non-evil hack to keep
my appliations in a neat one bundle (counting that the user should be
able to start only one main binary, while other binaries are started
automatically by agent or by the main application).

I'm thinking that this would be convenient for the user - if he is
annoyed by my app, he just moves my bundle to a trash bin, and the job
is done :)
Thanks!
___

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: Debugging a self made Framework

2010-10-25 Thread Uli Kusterer
On 24.10.2010, at 17:56, Frank Gregor wrote:
> after hours of searching the web & reading the docs, however I'm unable to 
> debug my framework. I've builded it with "Debug" config and added this 
> builded framework to my project. When I start debugging my project, setting a 
> breakpoint at an object from a class declared in the framework a "Step into 
> method" don't work. It always steps over...
> 
> Can someone give me a hint or link please, where it is described in detail 
> how to debug such a constellation?

Have you tried adding a "Custom Executable" to your framework target that 
points to the application that uses your framework? Then you can choose "Debug" 
in the framework project and it'll launch your app and you can have breakpoints.

 PS - I just saw your second post, a mere 3 hours after the first one. It's 
impolite to keep reposting messages. Keep in mind people are in different time 
zones here. It'll take about 24 hours for each country to have had an 
opportunity to see your message, why annoy everyone by posting a second, 
identical message? Patience, young grasshopper.

-- Uli Kusterer
Sole Janitor
http://www.the-void-software.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


Re: Audio Streaming with Cocoa

2010-10-25 Thread Uli Kusterer
On 25.10.2010, at 16:10, Bilel Mhedhbi wrote:
> I want to practice and make my own radio player with Cocoa. I just want to 
> know what are your ideas about how to get an audio stream across the internet 
> (I already did something, but I want to know your ideas before I show it to 
> you).

 CoreAudio and NSURLConnection?

 PS - don't bother showing me your code.

-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.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


Re: Move UINavigationBar down?

2010-10-25 Thread Uli Kusterer
On 26.10.2010, at 00:12, Stephen Zyszkiewicz wrote:
> Should I be trying to adjust the navigation controller frame, or should I 
> instead try to add the navigation controller to another view that is below 
> the top of the screen?

 Either sounds good. It's probably faster if you just try both than wait for us 
to make a suggestion.

-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.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


Re: Few binaries in one application's Bundle

2010-10-25 Thread Uli Kusterer
On 26.10.2010, at 00:23, eveningnick eveningnick wrote:
> The problem is, when either one of binaries is started, no one else
> from this bundle can be launched. The bundle itself is
> "LSUIElement=TRUE".
> I was wondering, if i could use some technique/non-evil hack to keep
> my appliations in a neat one bundle (counting that the user should be
> able to start only one main binary, while other binaries are started
> automatically by agent or by the main application).

 I usually put helper executables in Resources instead of in MacOS. Maybe that 
fixes it?

-- Uli Kusterer
Sole Janitor
http://www.the-void-software.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


Re: Few binaries in one application's Bundle

2010-10-25 Thread eveningnick eveningnick
Thanks Uli, it worked!
___

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: Audio Streaming with Cocoa

2010-10-25 Thread Jean-Daniel Dupas

Le 26 oct. 2010 à 00:36, Uli Kusterer a écrit :

> On 25.10.2010, at 16:10, Bilel Mhedhbi wrote:
>> I want to practice and make my own radio player with Cocoa. I just want to 
>> know what are your ideas about how to get an audio stream across the 
>> internet (I already did something, but I want to know your ideas before I 
>> show it to you).
> 
> CoreAudio and NSURLConnection?
> 
> PS - don't bother showing me your code.

Have a look at  AudioFileStreamExample. Look like it show how to play a stream.

http://developer.apple.com/library/mac/#samplecode/AudioFileStreamExample/Introduction/Intro.html



-- 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


FSCopyObjectSync() failing to overwrite on 10.6?

2010-10-25 Thread Jo Meder
Hi,

I'm using FSCopyObjectSync() to copy a file and want it to overwrite the 
destination file if it exists. However I've discovered this isn't working on 
10.6. I'm getting error -48 which is the duplicate filename error. Fair enough, 
I'm trying to copy and overwrite a file with the same name, but I do set the 
kFSFileOperationOverwrite flag! It's working fine on 10.4 and 10.5.

Has anyone else seen these problems? I did a search and found someone mentioned 
this bug recently:

7102368 - FSCopyObjectSync ignores kFSFileOperationOverwrite

which I presume is the same issue.

Are there any workarounds aside from deleting the destination file first if it 
exists?

Regards,

Jo Meder___

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: Few binaries in one application's Bundle

2010-10-25 Thread Dave Keck
>> The problem is, when either one of binaries is started, no one else
>> from this bundle can be launched. The bundle itself is
>> "LSUIElement=TRUE".
>> I was wondering, if i could use some technique/non-evil hack to keep
>> my appliations in a neat one bundle (counting that the user should be
>> able to start only one main binary, while other binaries are started
>> automatically by agent or by the main application).
>
>  I usually put helper executables in Resources instead of in MacOS. Maybe 
> that fixes it?

I believe the current recommendation is to place helper bundles in
Contents and single-file executables in MacOS. See this post:

http://lists.apple.com/archives/Apple-cdsa/2008/Jan/msg00053.html

and TN2206, under "Helper tools and other executable extras":

http://developer.apple.com/library/mac/#technotes/tn2007/tn2206.html

Though I'm not sure what OP means by no "one else from this bundle can
be launched"?
___

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: Drag and drop between two table views.

2010-10-25 Thread Graham Cox

On 26/10/2010, at 8:54 AM, Paul Johnson wrote:

> I am trying to drag and drop from one text view

^^ you mean TABLE view, right?

> to another. I can write an
> index set of copied rows to the pasteboard using:
> 
> 
> - (BOOL)tableView:(NSTableView *)tv
> 
> writeRowsWithIndexes:(NSIndexSet *)rowIndexes
> 
>toPasteboard:(NSPasteboard*)pboard {
> 
>  // Copy the row numbers to the pasteboard.
> 
>  NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
> 
>  [pboard declareTypes:[NSArray arrayWithObject:NSDragPboard] owner:self];
> 
>  [pboard setData:data forType:NSDragPboard];
> 
>  return YES;
> 
> }


This is totally confused and broken.

The rowIndexes just tell you which rows to copy; they do not contain those 
row's data. You can use the indexes in the index set to find out which data 
items in your data model you want to copy to the pasteboard. You are archiving 
the rowIndexes themselves, which information is unlikely to be of much interest 
to the destination.

Once you have the actual data, you write it to the dragging pasteboard using an 
appropriate type. For private data of your own, you need to make up something 
suitable for the type - NSDragPBoard is NOT a type name, it is a pasteboard 
name and should not be used here.

> In the array controller for the destination text view, I have
> 
> 
> - (BOOL)tableView:(NSTableView *)aTableView
> 
>   acceptDrop:(id )info
> 
>  row:(NSInteger)row
> 
>dropOperation:(NSTableViewDropOperation)operation
> 
> {
> 
>  NSPasteboard* pboard = [info draggingPasteboard];
> 
>  NSData* rowData = [pboard dataForType:NSDragPboard];


Same error here, NSDragPBoard is NOT a type name. This should be whatever you 
used in the write method, and for private data is a name you made up. Note that 
for some kinds of data there are suitable predefined type names but if you use 
those you have to ensure that the data is written in the appropriate format.


> 
>  NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData
> :rowData];
> 
>  NSInteger dragRow = [rowIndexes firstIndex];
> 
> 
> 
>  // Move the specified row to its new location...
> 
>  NSLog(@"count = %i", [rowIndexes count]);
> 
>  while(dragRow != NSNotFound)
> 
>  {
> 
>NSLog(@" %i", dragRow);
> 
>dragRow = [rowIndexes indexGreaterThanIndex:dragRow];
> 
>//  Copy a row here. 
> 
>  }
> 
>  return YES;
> 
> }
> 
> 
> I'm having trouble figuring out the correct code in the while-loop where I
> need to copy a row.


Because you archived the source table's row indexes rather than the data they 
index, that's what you get back. At this point that information only makes 
sense in the context of the source table. While that can be made to work (as a 
private transaction between data models in your app, you could have the second 
table ask for the data from the source here, but it's more conventional to pass 
the data itself, so you have it already here, where it's needed).

If you can fix up these issues, putting the data into the destination is a case 
of inserting the data items at the row you're given and calling -reloadData on 
the table so that it draws the updated table.

I should factor out the data movement or copy into methods on your data model, 
e.g. [myDataModel dataForIndexes:(NSIndexSet*) indexes] and [myDataModel 
insertData:(NSData*) data atIndex:(NSUInteger) index]; so that you have a pair 
of simple methods you can call from the table's drag/drop handling methods. 
Since they are views they should not be making too many assumptions about the 
data they are displaying.

I assume you have also registered the destination table view to receive drags 
of the desired type? Since you have not used a correct type name I suspect that 
step is also missing.

--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