Re: BSD TCP Programming on iPad

2011-04-28 Thread Bing Li
Dear Lance,

Your experiences are important to me. I would like to use BSD sockets to
implement the peer-to-peer model.

I got a basic problem. I follow the book, Unix Network Programming, 3rd
edition. When compiling the simple code, TCPEchoServer, some errors exist in
unp.h. Moreover, the basic APIs, such as Socket, Bind and etc, cannot be
linked.

I commented the lines that cause errors in unp.h. Is it proper? But I don't
know which frameworks in Cocoa should be added so that Socket and Bind can
be compiled.

Could you please give me a hand?

Thanks,
Bing


On Thu, Apr 28, 2011 at 1:12 AM, lbland  wrote:

> hi-
>
> On Apr 27, 2011, at 12:25 PM, Bing Li wrote:
>
> > Therefore, I hope I could use TCP to design the protocol directly instead
> of
> > using HTTP.
> >
> > However, I have NOT got sufficient materials to program TCP on iPad.
>
> It is just BSD sockets ... get the book. It is: UNIX Network Programming by
> Richard Stevens
>
> We turned an iPhone into a custom HTTP web server that we made from scratch
> (using BSD sockets and TCP/IP) and it worked! ... so it is possible,
> especially if you like to roll your own.
>
> thanks!-
>
> -lance
>
>
___

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


How to store main window frame to user defaults?

2011-04-28 Thread Vyacheslav Karamov

Hi All!

I need to save main window size and position to user defaults:

 NSValue * rect = [NSValue valueWithRect: [[NSApp mainWindow] frame]];
 [[NSUserDefaults standardUserDefaults] setObject:rect 
forKey:@"MainWndFrame"];


but console output is:

2011-04-28 11:45:00.139 UserDefaults[32801:a0f] *** -[NSUserDefaults 
setObject:forKey:]: Attempt to insert non-property value 'NSRect: {{525, 
701}, {303, 99}}' of class 'NSConcreteValue'.

___

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: How to store main window frame to user defaults?

2011-04-28 Thread Aaron Burghardt
Use NSStringFromRect() and NSRectFromString() to convert to/from a string to 
store in the defaults. However, it might be easier to set frameAutosaveName and 
let the window save and restore the frame itself. Just enter the key in the 
autosave attribute in Interface Builder and it should work.

Aaron

On Apr 28, 2011, at 4:50 AM, Vyacheslav Karamov wrote:

> Hi All!
> 
> I need to save main window size and position to user defaults:
> 
> NSValue * rect = [NSValue valueWithRect: [[NSApp mainWindow] frame]];
> [[NSUserDefaults standardUserDefaults] setObject:rect forKey:@"MainWndFrame"];
> 
> but console output is:
> 
> 2011-04-28 11:45:00.139 UserDefaults[32801:a0f] *** -[NSUserDefaults 
> setObject:forKey:]: Attempt to insert non-property value 'NSRect: {{525, 
> 701}, {303, 99}}' of class 'NSConcreteValue'.
> ___
> 
> 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/aaron.burghardt%40gmail.com
> 
> This email sent to aaron.burgha...@gmail.com

___

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

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

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

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


Show UIActivityIndicatorView asynchronously

2011-04-28 Thread Philip Vallone
Hi,

I have a UIViewController that can take a few seconds to load. The view 
searches an XML file and eventually displays the resuts.  I want to show a 
UIActivityIndicatorView while the view loads. Unfortunately they are on the 
same thread. How can I get the UIActivityIndicatorView to display befiore the 
view loads? With the below code, the UI freezes up (indicator never shows) 
until the search is done.

[self.activityIndicator startAnimating];   

TitleSearchResultsViewController *controller = 
[[TitleSearchResultsViewController alloc] 
initWithNibName:@"TitleSearchResultsViewController" bundle:nil];
[controller setTitle:@"Search Results"];


Thanks,

Phil





___

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: How to store main window frame to user defaults?

2011-04-28 Thread Vyacheslav Karamov
I can't use Interface builder, because it crashes while opening NIB 
file. I'm currently using XCode 3.2.6, but NIB file was created with IB 
2.x using plug-in.
So, where is it better to save main window frame? I've tried to do do it 
in [NSWindow close]:


- (void) close
{
NSString * rc = NSStringFromRect([[NSApp mainWindow] frame]);
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject: rc forKey:@"MainWndFrame"];
[super close];
}

but it doesn't work.


28-Apr-11 12:14, Aaron Burghardt пишет:

Use NSStringFromRect() and NSRectFromString() to convert to/from a string to 
store in the defaults. However, it might be easier to set frameAutosaveName and 
let the window save and restore the frame itself. Just enter the key in the 
autosave attribute in Interface Builder and it should work.

Aaron

On Apr 28, 2011, at 4:50 AM, Vyacheslav Karamov wrote:


Hi All!

I need to save main window size and position to user defaults:

NSValue * rect = [NSValue valueWithRect: [[NSApp mainWindow] frame]];
[[NSUserDefaults standardUserDefaults] setObject:rect forKey:@"MainWndFrame"];

but console output is:

2011-04-28 11:45:00.139 UserDefaults[32801:a0f] *** -[NSUserDefaults 
setObject:forKey:]: Attempt to insert non-property value 'NSRect: {{525, 701}, 
{303, 99}}' of class 'NSConcreteValue'.
___

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/aaron.burghardt%40gmail.com

This email sent to aaron.burgha...@gmail.com





___

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

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

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

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


Accessing NSWIndowController attribute from a subview in IB

2011-04-28 Thread Ben Golding

I feel like I should be able to figure this out but I feel like I'm going 
around circles.  I've looked through the mailing list and can't find anything 
similar (but I might be searching using the wrong terms).

I have a document-based app which loads a couple of NSWindowController 
subclasses.  That's fine.  In one of the subclasses, I load a nib with a NSView 
subclass.  It wants to access one of the instance vars in the window controller 
subclass.  I thought "no worries, I should be able to hook up a connection in 
IB and it will be right".

In my NSWindowController subclass (called "Face"), I have a method:

- (id)initWithSundial:(Sundial *)sundial
{
if ((self = [super initWithWindowNibName:@"Face"]) == nil)
return nil;

[self setSundial:sundial];

return self;
}

In the window that's loaded from Face.xib, there's a custom view (SundialView) 
which needs to access the sundial instance variable in File's Owner.  I just 
don't seem to be able to control-drag in some order to hook them up and I think 
I should be able to.

Am I doing this the wrong way or do I have some sort of misunderstanding about 
how this works?

Ben.

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: How to store main window frame to user defaults?

2011-04-28 Thread Matt Gough
How about calling just calling [NSWindow 
setFrameAutosaveName:@"YourAutosaveName"] during awakeFromNib?



Matt
On 28 Apr 2011, at 11:32, Vyacheslav Karamov wrote:

> I can't use Interface builder, because it crashes while opening NIB file. I'm 
> currently using XCode 3.2.6, but NIB file was created with IB 2.x using 
> plug-in.
> So, where is it better to save main window frame? I've tried to do do it in 
> [NSWindow close]:
> 
> - (void) close
> {
> NSString * rc = NSStringFromRect([[NSApp mainWindow] frame]);
> NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
> [defaults setObject: rc forKey:@"MainWndFrame"];
> [super close];
> }
> 
> but it doesn't work.
> 
> 
> 28-Apr-11 12:14, Aaron Burghardt пишет:
>> Use NSStringFromRect() and NSRectFromString() to convert to/from a string to 
>> store in the defaults. However, it might be easier to set frameAutosaveName 
>> and let the window save and restore the frame itself. Just enter the key in 
>> the autosave attribute in Interface Builder and it should work.
>> 
>> Aaron
>> 
>> On Apr 28, 2011, at 4:50 AM, Vyacheslav Karamov wrote:
>> 
>>> Hi All!
>>> 
>>> I need to save main window size and position to user defaults:
>>> 
>>> NSValue * rect = [NSValue valueWithRect: [[NSApp mainWindow] frame]];
>>> [[NSUserDefaults standardUserDefaults] setObject:rect 
>>> forKey:@"MainWndFrame"];
>>> 
>>> but console output is:
>>> 
>>> 2011-04-28 11:45:00.139 UserDefaults[32801:a0f] *** -[NSUserDefaults 
>>> setObject:forKey:]: Attempt to insert non-property value 'NSRect: {{525, 
>>> 701}, {303, 99}}' of class 'NSConcreteValue'.
>>> ___
>>> 
>>> 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/aaron.burghardt%40gmail.com
>>> 
>>> This email sent to aaron.burgha...@gmail.com
>> 
>> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mgough%40humyo.com
> 
> This email sent to mgo...@humyo.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: CoreData: "Could not fulfill a fault", but only sometimes…

2011-04-28 Thread Felix Franz
Hi, 

On Apr 27, 2011, at 11:55 PM, Sean McBride wrote:

> On Thu, 21 Apr 2011 10:52:31 +0200, Felix Franz said:
> 
>> I have a strange bug in my CoreData-Application (sql store). I received
>> bug reports where the program throws
>> an exception "Could not fulfill a fault". This happens while loading the
>> document. The only way
>> I can reproduce this problem is using the "Time Profiler" in Instruments
>> while loading a big document.
> 
> Very interesting!
> 
> A couple of months ago, we were using Instruments to profile the
> performance of saving documents and came upon exactly this problem.  We
> were never able to repro without Instruments and so assumed it was a bug
> in Instruments.  Disturbing to hear that your customers have seen it in
> the wild.  We have not yet had the chance to file a radar, did you?

I did: the radar number is 9350969. 

Cheers, 

Felix



___

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: How to store main window frame to user defaults?

2011-04-28 Thread Vyacheslav Karamov

It works!
Thank you!

P.S. But I still can't understand why frame saving code doesn't work 
from [NSWindow close]


28-Apr-11 14:35, Matt Gough пишет:

How about calling just calling [NSWindow 
setFrameAutosaveName:@"YourAutosaveName"] during awakeFromNib?



Matt
On 28 Apr 2011, at 11:32, Vyacheslav Karamov wrote:


I can't use Interface builder, because it crashes while opening NIB file. I'm 
currently using XCode 3.2.6, but NIB file was created with IB 2.x using plug-in.
So, where is it better to save main window frame? I've tried to do do it in 
[NSWindow close]:

- (void) close
{
NSString * rc = NSStringFromRect([[NSApp mainWindow] frame]);
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject: rc forKey:@"MainWndFrame"];
[super close];
}

but it doesn't work.


28-Apr-11 12:14, Aaron Burghardt пишет:

Use NSStringFromRect() and NSRectFromString() to convert to/from a string to 
store in the defaults. However, it might be easier to set frameAutosaveName and 
let the window save and restore the frame itself. Just enter the key in the 
autosave attribute in Interface Builder and it should work.

Aaron

On Apr 28, 2011, at 4:50 AM, Vyacheslav Karamov wrote:


Hi All!

I need to save main window size and position to user defaults:

NSValue * rect = [NSValue valueWithRect: [[NSApp mainWindow] frame]];
[[NSUserDefaults standardUserDefaults] setObject:rect forKey:@"MainWndFrame"];

but console output is:

2011-04-28 11:45:00.139 UserDefaults[32801:a0f] *** -[NSUserDefaults 
setObject:forKey:]: Attempt to insert non-property value 'NSRect: {{525, 701}, 
{303, 99}}' of class 'NSConcreteValue'.
___

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/aaron.burghardt%40gmail.com

This email sent to aaron.burgha...@gmail.com



___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/mgough%40humyo.com

This email sent to mgo...@humyo.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: Stack of NSWindow sheets

2011-04-28 Thread Andreas Mayer

Am 28.04.2011 um 04:31 schrieb Lee Ann Rucker:

> It would be nice if there was some sort of built-in combining stack, 
> especially for the info-only dialogs, the way starting multiple file copies 
> in the Finder gives you one window with multiple sections instead of multiple 
> windows.

Why not build one if you need it? Does not sound that hard.

Maybe you can utilize my collection view class: 
http://www.harmless.de/cocoa-code.php#collectionview


Andreas___

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


Binding a to-many relationship into a table subview of NSCollectionItemView

2011-04-28 Thread Gustavo Pizano
Hello all.

I have been researching and I only found somebody who had the same problem, but 
the question went unsolved, so Im sorry if I ask again, I hope somebody can 
enlighten me. 

I have a NSCollectionView and its respective NSCollectionViewItem,  also I have 
a NSTableView wich displays the properties of an Entity VERSION,  The 
NSCollecitonView contents its bound to the selectedObjects of this table, so 
one I select something (1 or more) I see that the view I designed for the 
NSCollectionViewItem appears with the properties of VERSION (which were bound 
to the NSCollectionViewItem as representedObject.number , etc).
Now problem is that VERSION has a to-many relation with a entity called 
FILES_PER_VERSION, and in the view of the NSCollectionViewItem need to display 
in a table the properties of this entity.

I have tried using directly IB bindings but that doesnt seem to work. So I 
subclassed NSCollectionViewController and add a NSArrayController as an ivar 
called representedToVersionFilesArrayController.

then in the setRepresentedObject Im doing the following:



-(void)setRepresentedObject:(id)representedObject{
[super setRepresentedObject:representedObject];

if([[representedObject entity].name isEqualToString:DPA_VERSION_KEY] ){
NSLog(@"DP Analyzer >>> represented Object is kind of entity 
DPAVersionFile");
DPAVersion * ver = (DPAVersion *)representedObject;
NSLog(@"DP Analyzer >>>  Got version files ");
self.representedToVersionFilesSet = [[NSArrayController alloc] init];
[self.representedToVersionFilesSet setAutomaticallyPreparesContent:YES];
[self.representedToVersionFilesSet setEntityName:DPA_FILE_VERSION_KEY];
[self.representedToVersionFilesSet 
setManagedObjectContext:[(DP_AnalyzerAppDelegate *)[[NSApplication 
sharedApplication] delegate] managedObjectContext]];
[self.representedToVersionFilesSet bind:@"contentSet" toObject:ver  
withKeyPath:DPA_VERSION_TO_VERSION_FILES_KEY options:nil];

}


}

and then in IB in the table with is inside the view of the 
NSCollectionViewController (or in this case my subclass of it), Im binding each 
table column to 
representedToVersionFilesArrayController.arrangedObjects.http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Aliases with NDAlias not appearing where I tell them to be.

2011-04-28 Thread Sean McBride
On Wed, 27 Apr 2011 18:17:21 -0400, Kevin Muldoon said:

>Alias file!

I've not used NDAlias for alias files, only for alias records.  I just
looked at the example, and it does seems somewhat crusty.  Still, I
think you are misunderstanding the 'fromFile' parameter.  Have you read
Apple's docs for FSNewAlias()?  That should clarify things.  I'll be
pushing a couple of minor fixes to the example regardless.

>Just like one created when we option-drag files from one
>directory to another in the Finder.

Command-option-drag. :)

>Yeah, I'd love to require 10.6 but
>not a fit for our environment. Honestly, I'm perplexed this feature
>hasn't already been packaged into the standard obj-c libraries until
>just now.

The standard conspiracy theory is because aliases come from Classic Mac
OS, and the unix/Cocoa folks hated everything from there, that they were
never added.  Whatever the delay, they are finally in Cocoa as of 10.6.
Mysteriously, they decided to switch from the term 'alias' to 'bookmark'
despite the term alias being consistently used in both the UI and API
since System 7 (and the term 'alias' persists in the UI, and the term
'bookmark' is already overloaded). Rant over. :)

--

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: Show UIActivityIndicatorView asynchronously

2011-04-28 Thread Alexander Spohr

Am 28.04.2011 um 12:26 schrieb Philip Vallone:

> Hi,
> 
> I have a UIViewController that can take a few seconds to load. The view 
> searches an XML file and eventually displays the resuts.  I want to show a 
> UIActivityIndicatorView while the view loads. Unfortunately they are on the 
> same thread. How can I get the UIActivityIndicatorView to display befiore the 
> view loads?

You can not. The display will wait for the end of the runloop.

> With the below code, the UI freezes up (indicator never shows) until the 
> search is done.

Your UI would still freeze, even if you could get the indicator on screen.

> [self.activityIndicator startAnimating];   
> 
> TitleSearchResultsViewController *controller = 
> [[TitleSearchResultsViewController alloc] 
> initWithNibName:@"TitleSearchResultsViewController" bundle:nil];
> [controller setTitle:@"Search Results"];

Your controller needs to to its work in another thread and signal the main 
thread if it is done.

atze


___

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: BSD TCP Programming on iPad

2011-04-28 Thread Scott Ribe
On Apr 28, 2011, at 2:45 AM, Bing Li wrote:

> But I don't
> know which frameworks in Cocoa should be added so that Socket and Bind can
> be compiled.

I think it's CoreFoundation or CoreServices...

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.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: Accessing NSWIndowController attribute from a subview in IB

2011-04-28 Thread Alexander Spohr

Am 28.04.2011 um 13:28 schrieb Ben Golding:

> I have a document-based app which loads a couple of NSWindowController 
> subclasses.  That's fine.  In one of the subclasses, I load a nib with a 
> NSView subclass.  It wants to access one of the instance vars in the window 
> controller subclass.  I thought "no worries, I should be able to hook up a 
> connection in IB and it will be right".

You can not connect to an ivar/attribute of an object. You can just connect to 
an object.

> In my NSWindowController subclass (called "Face"), I have a method:
> 
> - (id)initWithSundial:(Sundial *)sundial
> {
>if ((self = [super initWithWindowNibName:@"Face"]) == nil)
>return nil;
> 
>[self setSundial:sundial];
> 
>return self;
> }
> 
> In the window that's loaded from Face.xib, there's a custom view 
> (SundialView) which needs to access the sundial instance variable in File's 
> Owner.  I just don't seem to be able to control-drag in some order to hook 
> them up and I think I should be able to.
> 
> Am I doing this the wrong way or do I have some sort of misunderstanding 
> about how this works?

Either or both.

The view itself should not know anything about its controller or the 
controllers ivars. Wrong direction.
You should make your WindowController set SundialView's sundial when it has 
been loaded. Problem solved.

atze___

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: How to store main window frame to user defaults?

2011-04-28 Thread Aaron Burghardt

On Apr 28, 2011, at 7:42 AM, Vyacheslav Karamov wrote:

> It works!
> Thank you!
> 
> P.S. But I still can't understand why frame saving code doesn't work from 
> [NSWindow close]
> 
> 28-Apr-11 14:35, Matt Gough пишет:
>> How about calling just calling [NSWindow 
>> setFrameAutosaveName:@"YourAutosaveName"] during awakeFromNib?
>> 
>> 
>> 
>> Matt
>> On 28 Apr 2011, at 11:32, Vyacheslav Karamov wrote:
>> 
>>> I can't use Interface builder, because it crashes while opening NIB file. 
>>> I'm currently using XCode 3.2.6, but NIB file was created with IB 2.x using 
>>> plug-in.
>>> So, where is it better to save main window frame? I've tried to do do it in 
>>> [NSWindow close]:
>>> 
>>> - (void) close
>>> {
>>> NSString * rc = NSStringFromRect([[NSApp mainWindow] frame]);
>>> NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
>>> [defaults setObject: rc forKey:@"MainWndFrame"];
>>> [super close];
>>> }
>>> 
>>> but it doesn't work.

Is the window in the NIB a standard NSWindow or is a subclass? You can't 
override -[MYWindow close] in your subclass and expect it to change the 
behavior of the superclass.

If the window in the NIB is an instance of your subclass, then the explanation 
may be that the runtime is skipping some cleanup and exiting quickly, leaving 
the cleanup to the OS. I think it does this instead of releasing/freeing some 
objects, but I'm not sure what else might be skipped. Regardless, it probably 
makes more sense to move your code to the NSApplication delegate method 
applicationWillTerminate:.

Aaron

___

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


Tab spacing in NSTextView

2011-04-28 Thread Дмитрий Николаев
Hello!

I'm trying override - boundingBoxForControlGlyphAtIndex for NSTypesetter, but 
logs shows that this method never called.

If this is most appropriate place to override position of the tab 
?___

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: Binding a to-many relationship into a table subview of NSCollectionItemView

2011-04-28 Thread Gustavo Pizano
Hello again me.

So I solved this doing the following.

Separate the NSColletionViewItem into a different XIB.
In the Main Xib the the Object Controller for the NSColletionViewItem tell it 
to load from that new XIB.
Now the funny part, Bindings and Core Data still doesn't work, so what I did 
was :


-(void)setRepresentedObject:(id)representedObject{
[super setRepresentedObject:representedObject];

if([[representedObject entity].name isEqualToString:DPA_VERSION_KEY] ){
DPAVersion * ver = (DPAVersion *)representedObject;
self.dataSource = [[NSArray arrayWithArray:[[ver 
valueForKey:DPA_VERSION_TO_VERSION_FILES_KEY] allObjects]] retain];
}
 
}


and then I connect the dataSoruces and delegate of the table view to the File 
Owner (which is my subclass of NSCollectionViewItem), and then implemetn the 
proper methods and voila it worked..

Now a downside is that I will have to implement the sort of the table because I 
lost that feature as Im not using an NSArrayController to populate the table 
but a datasource.

G.





On Apr 28, 2011, at 3:35 PM, Gustavo Pizano wrote:

> Hello all.
> 
> I have been researching and I only found somebody who had the same problem, 
> but the question went unsolved, so Im sorry if I ask again, I hope somebody 
> can enlighten me. 
> 
> I have a NSCollectionView and its respective NSCollectionViewItem,  also I 
> have a NSTableView wich displays the properties of an Entity VERSION,  The 
> NSCollecitonView contents its bound to the selectedObjects of this table, so 
> one I select something (1 or more) I see that the view I designed for the 
> NSCollectionViewItem appears with the properties of VERSION (which were bound 
> to the NSCollectionViewItem as representedObject.number , etc).
> Now problem is that VERSION has a to-many relation with a entity called 
> FILES_PER_VERSION, and in the view of the NSCollectionViewItem need to 
> display in a table the properties of this entity.
> 
> I have tried using directly IB bindings but that doesnt seem to work. So I 
> subclassed NSCollectionViewController and add a NSArrayController as an ivar 
> called representedToVersionFilesArrayController.
> 
> then in the setRepresentedObject Im doing the following:
> 
> 
> 
> -(void)setRepresentedObject:(id)representedObject{
>[super setRepresentedObject:representedObject];
> 
>if([[representedObject entity].name isEqualToString:DPA_VERSION_KEY] ){
>NSLog(@"DP Analyzer >>> represented Object is kind of entity 
> DPAVersionFile");
>DPAVersion * ver = (DPAVersion *)representedObject;
>NSLog(@"DP Analyzer >>>  Got version files ");
>self.representedToVersionFilesSet = [[NSArrayController alloc] init];
>[self.representedToVersionFilesSet 
> setAutomaticallyPreparesContent:YES];
>[self.representedToVersionFilesSet setEntityName:DPA_FILE_VERSION_KEY];
>[self.representedToVersionFilesSet 
> setManagedObjectContext:[(DP_AnalyzerAppDelegate *)[[NSApplication 
> sharedApplication] delegate] managedObjectContext]];
>[self.representedToVersionFilesSet bind:@"contentSet" toObject:ver  
> withKeyPath:DPA_VERSION_TO_VERSION_FILES_KEY options:nil];
> 
>}
> 
> 
> }
> 
> and then in IB in the table with is inside the view of the 
> NSCollectionViewController (or in this case my subclass of it), Im binding 
> each table column to 
> representedToVersionFilesArrayController.arrangedObjects. 
> results nothing yet, so i dunno what am i missing or doing really bad. I have 
> checked that [ver valueForKey: DPA_VERSION_TO_VERSION_FILES_KEY] is returning 
> me an NSSet with the entities related to ver, so there is data, but I hadn't 
> been able to bind it to the table.
> 
> Any suggestions?
> Please ?
> 
> thx
> 
> Gustavo
> 

___

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: Tab spacing in NSTextView

2011-04-28 Thread Kyle Sluder
2011/4/28 Дмитрий Николаев :
> Hello!
>
> I'm trying override - boundingBoxForControlGlyphAtIndex for NSTypesetter, but 
> logs shows that this method never called.
>
> If this is most appropriate place to override position of the tab ?

No. It will be *far* easier to use -[NSParagraphStyle tabStops] or
-[NSParagraphStyle defaultTabInterval] with tab characters, rather
than control glyphs and a custom typesetter.

--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: How to store main window frame to user defaults?

2011-04-28 Thread Quincey Morris
On Apr 28, 2011, at 04:42, Vyacheslav Karamov wrote:

> P.S. But I still can't understand why frame saving code doesn't work from 
> [NSWindow close]

It doesn't work because NSValue objects aren't valid in a property list, which 
is what the user defaults are.

That's why, if you can't using the window's autosave name for some reason, you 
use NSStringFromRect() instead, as was already suggested.

Another alternative is to use a NSData object, whose data is an archive (via 
NSKeyedArchiver encodeRectForKey:, most easily) of the frame. You use an 
archive so that architecture (word size/endianness) issues are taken care of 
for you automatically.


___

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: Accessing NSWIndowController attribute from a subview in IB

2011-04-28 Thread Quincey Morris
On Apr 28, 2011, at 04:28, Ben Golding wrote:

> In the window that's loaded from Face.xib, there's a custom view 
> (SundialView) which needs to access the sundial instance variable in File's 
> Owner.  I just don't seem to be able to control-drag in some order to hook 
> them up and I think I should be able to.

You could control-drag to connect a controller *outlet* to a view.

You could control-drag to connect a control's *action* to a target.

But you're doing neither here. You don't need to. The code in your custom view 
can simply access the controller property directly as '[[[self window] 
windowController] sundial]'.

There are only a couple of gotchas in this.

First, make sure that the window controller's 'window' outlet is actually 
connected to the window in the NIB.

Second, the view's access to the window's windowController property won't be 
available until some point in the NIB loading process (specifically, not until 
after the view is added to the window's view hierarchy). If you try to 
reference the property too early, you'll get nil. 'viewDidMoveToWindow:' is a 
good place to intervene if you want to know when the window controller is 
available to the 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


Re: Show UIActivityIndicatorView asynchronously

2011-04-28 Thread Matt Neuburg
On Thu, 28 Apr 2011 06:26:17 -0400, Philip Vallone  
said:
>Hi,
>
>I have a UIViewController that can take a few seconds to load. The view 
>searches an XML file and eventually displays the resuts.  I want to show a 
>UIActivityIndicatorView while the view loads. Unfortunately they are on the 
>same thread. How can I get the UIActivityIndicatorView to display befiore the 
>view loads? With the below code, the UI freezes up (indicator never shows) 
>until the search is done.
>
>[self.activityIndicator startAnimating];   
>
>TitleSearchResultsViewController *controller = 
>[[TitleSearchResultsViewController alloc] 
>initWithNibName:@"TitleSearchResultsViewController" bundle:nil];
>[controller setTitle:@"Search Results"];

Use delayed performance. Here's sample code from one of my own apps:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath 
*)indexPath {
[act startAnimating];
// jump out using delayed performance, to give us a chance to start 
animating the UIActivityIndicatorView
[self performSelector:@selector(showItemsForRow:) withObject:indexPath 
afterDelay:0.1];
}

And then showItemsForRow inits the view controller and loads its view in the 
usual way. m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook___

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: Show UIActivityIndicatorView asynchronously

2011-04-28 Thread Philip Vallone
Thanks. Works like a charm. 

Regards,

Phil

Sent from Phil's iPhone

On Apr 28, 2011, at 1:38 PM, Matt Neuburg  wrote:

> On Thu, 28 Apr 2011 06:26:17 -0400, Philip Vallone 
>  said:
>> Hi,
>> 
>> I have a UIViewController that can take a few seconds to load. The view 
>> searches an XML file and eventually displays the resuts.  I want to show a 
>> UIActivityIndicatorView while the view loads. Unfortunately they are on the 
>> same thread. How can I get the UIActivityIndicatorView to display befiore 
>> the view loads? With the below code, the UI freezes up (indicator never 
>> shows) until the search is done.
>> 
>> [self.activityIndicator startAnimating];   
>> 
>> TitleSearchResultsViewController *controller = 
>> [[TitleSearchResultsViewController alloc] 
>> initWithNibName:@"TitleSearchResultsViewController" bundle:nil];
>> [controller setTitle:@"Search Results"];
> 
> Use delayed performance. Here's sample code from one of my own apps:
> 
> - (void)tableView:(UITableView *)tableView 
> didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
>[act startAnimating];
>// jump out using delayed performance, to give us a chance to start 
> animating the UIActivityIndicatorView
>[self performSelector:@selector(showItemsForRow:) withObject:indexPath 
> afterDelay:0.1];
> }
> 
> And then showItemsForRow inits the view controller and loads its view in the 
> usual way. m.
> 
> --
> matt neuburg, phd = m...@tidbits.com, 
> A fool + a tool + an autorelease pool = cool!
> Programming iOS 4!
> http://www.apeth.net/matt/default.html#iosbook
___

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: Aliases with NDAlias not appearing where I tell them to be.

2011-04-28 Thread Kevin Muldoon
FSNewAlias() huh? I'll take a look. So, you think I'm reversing the
'fromFile' parameter with 'aliasWithPath' ? That would be embarrassing!
Still, the example code shows the following...


NSString * kDirOfTestProject = @"~/Developer/Projects/NDAlias/"; // you need
to change this to the location of NDAlias


NSString * filePath = @"Test File.txt",

* folderPath = @"Test Folder",

* aliasFilePath = @"AliasFile";


testCreatingAliasFileFor( [[kDirOfTestProject stringByAppendingString:filePath]
stringByExpandingTildeInPath] );



void testCreatingAliasFileFor( NSString * aFilePath )

{

if( [[NDAlias aliasWithPath:aFilePath fromPath:NSHomeDirectory()]
writeToFile:aliasFilePath] )

{

printf("I have created an alias file for\n\t%s.\n", [aFilePath
fileSystemRepresentation]);

[[NSWorkspace sharedWorkspace] selectFile:aliasFilePath
inFileViewerRootedAtPath:@""];

}

else

{

printf("Alias file creation failed.\n");

}

}


or in other words..

The variable aFilePath passed into the function testCreatingAliasFileFor()
is clearly the full path of the file I want an alias of.

The NSHomeDirectory() at fromPath is clearly the path to the users home
directory.

The variable aliasFilePath (which should be renamed to something like
aliasFileName) is the name of the alias file that writeToFile needs,
apparently stringing fromPath of the method it's wrapped around.

Anyway, thanks for the rant! I very much appreciate a historical perspective
on things. I'll keep banging away it when time permits.



On Thu, Apr 28, 2011 at 9:54 AM, Sean McBride wrote:

> On Wed, 27 Apr 2011 18:17:21 -0400, Kevin Muldoon said:
>
> >Alias file!
>
> I've not used NDAlias for alias files, only for alias records.  I just
> looked at the example, and it does seems somewhat crusty.  Still, I
> think you are misunderstanding the 'fromFile' parameter.  Have you read
> Apple's docs for FSNewAlias()?  That should clarify things.  I'll be
> pushing a couple of minor fixes to the example regardless.
>
> >Just like one created when we option-drag files from one
> >directory to another in the Finder.
>
> Command-option-drag. :)
>
> >Yeah, I'd love to require 10.6 but
> >not a fit for our environment. Honestly, I'm perplexed this feature
> >hasn't already been packaged into the standard obj-c libraries until
> >just now.
>
> The standard conspiracy theory is because aliases come from Classic Mac
> OS, and the unix/Cocoa folks hated everything from there, that they were
> never added.  Whatever the delay, they are finally in Cocoa as of 10.6.
> Mysteriously, they decided to switch from the term 'alias' to 'bookmark'
> despite the term alias being consistently used in both the UI and API
> since System 7 (and the term 'alias' persists in the UI, and the term
> 'bookmark' is already overloaded). Rant over. :)
>
> --
> 
> 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: Aliases with NDAlias not appearing where I tell them to be.

2011-04-28 Thread Quincey Morris
On Apr 28, 2011, at 11:05, Kevin Muldoon wrote:

>   if( [[NDAlias aliasWithPath:aFilePath fromPath:NSHomeDirectory()] 
> writeToFile:aliasFilePath] )

Yes, but this isn't what you did, or what you wanted. The sample code is 
intentionally putting the created alias file in the *current* directory, which 
is why 'aliasFilePath' specifies no explicit directory. You want to put it in a 
different place (the desktop), but you passed 'aliasName' instead of 
'aliasFilePath' for that parameter.


___

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: iOS Version Install Base

2011-04-28 Thread Steve Christensen
We're only supporting iOS 4.0 and later since we feel like there's sufficient 
adoption rate to make it worthwhile. Certainly if you feel like you still need 
to support pre-4.0, you could build against the current 4.x SDK, set the 
deployment target to be iOS 3.x (or whatever), and conditionally include the 
non-block animation code with a runtime check to handle each case. Putting a 
build-time conditional around the "legacy" code, and runtime check, means that 
it automatically gets compiled out when your builds stop supporting pre-4.0.

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_4_0
if (![UIView 
respondsToSelector:@selector(animateWithDuration:animations:completion:)])
{
[UIView beginAnimations:...];
...
[UIView commitAnimations];
}
else
#endif
{
[UIView animateWithDuration:...];
}



On Apr 27, 2011, at 10:44 AM, koko wrote:

> I am looking at the UIView Animations Overview.
> 
> Block-based animations are recommended, but this iOS 4.
> 
> Is it best to use begin/commit methods for compatibility !
> 
> What are others doing?

___

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: Aliases with NDAlias not appearing where I tell them to be.

2011-04-28 Thread Sean McBride
On Thu, 28 Apr 2011 14:05:46 -0400, Kevin Muldoon said:

>Still, the example code shows the following...

Update from git... I have cleaned it up a bit.

>The variable aFilePath passed into the function testCreatingAliasFileFor()
>is clearly the full path of the file I want an alias of.

Correct.

>The NSHomeDirectory() at fromPath is clearly the path to the users home
>directory.

Correct.  And the point of this should be clearer after reading the
FSNewAlias() docs.

>The variable aliasFilePath (which should be renamed to something like
>aliasFileName)

Agreed; done.

>is the name of the alias file that writeToFile needs,
>apparently stringing fromPath of the method it's wrapped around.

I think Quincey is right, which is probably why the beginning of the
example calls and prints the result of getcwd().

--

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: Aliases with NDAlias not appearing where I tell them to be.

2011-04-28 Thread Sean McBride
On Thu, 28 Apr 2011 14:05:46 -0400, Kevin Muldoon said:

>[[NSWorkspace sharedWorkspace] selectFile:aliasFilePath
>inFileViewerRootedAtPath:@""];

This was wrong though, as 'aliasFilePath' was not a full path.  I've
fixed that in git.

--

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: iOS Version Install Base

2011-04-28 Thread koko
Steve -

I like your suggestion ... thanks.

-koko


On Apr 28, 2011, at 12:34 PM, Steve Christensen wrote:

> We're only supporting iOS 4.0 and later since we feel like there's sufficient 
> adoption rate to make it worthwhile. Certainly if you feel like you still 
> need to support pre-4.0, you could build against the current 4.x SDK, set the 
> deployment target to be iOS 3.x (or whatever), and conditionally include the 
> non-block animation code with a runtime check to handle each case. Putting a 
> build-time conditional around the "legacy" code, and runtime check, means 
> that it automatically gets compiled out when your builds stop supporting 
> pre-4.0.
> 
> #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_4_0
> if (![UIView 
> respondsToSelector:@selector(animateWithDuration:animations:completion:)])
> {
>   [UIView beginAnimations:...];
>   ...
>   [UIView commitAnimations];
> }
> else
> #endif
> {
>   [UIView animateWithDuration:...];
> }
> 
> 
> 
> On Apr 27, 2011, at 10:44 AM, koko wrote:
> 
>> I am looking at the UIView Animations Overview.
>> 
>> Block-based animations are recommended, but this iOS 4.
>> 
>> Is it best to use begin/commit methods for compatibility !
>> 
>> What are others doing?
> 
> 

___

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


onSocketDidDisconnect in CocoaAsyncSocket

2011-04-28 Thread Bing Li
Dear all,

I started to use CocoaAsyncSocket to establish TCP connections among iPads.

I got a problem. According to the references (
http://code.google.com/p/cocoaasyncsocket/wiki/Reference_AsyncSocket),
onSocketDidDisconnect would be invoked immediately if the connection is not
already disconnected. I felt confused. What does "not already disconnected"
mean? I think onSocketDidDisconnect should be called when a connection is
disconnected. The description in the reference is wrong?

I implemented a server and a client using CocoaAsyncSocket. When closing the
client disgracefully, I noticed that onSocketDidDisconnect was NOT called.
Anything wrong with it?

Thanks so much!
Bing
___

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: Stack of NSWindow sheets

2011-04-28 Thread Lee Ann Rucker
Oh, it's probably not. So many other interesting things are higher up the 
stack, though.

- Original Message -
From: "Andreas Mayer" 
To: cocoa-dev@lists.apple.com
Sent: Thursday, April 28, 2011 5:38:50 AM
Subject: Re: Stack of NSWindow sheets


Am 28.04.2011 um 04:31 schrieb Lee Ann Rucker:

> It would be nice if there was some sort of built-in combining stack, 
> especially for the info-only dialogs, the way starting multiple file copies 
> in the Finder gives you one window with multiple sections instead of multiple 
> windows.

Why not build one if you need it? Does not sound that hard.

Maybe you can utilize my collection view class: 
http://www.harmless.de/cocoa-code.php#collectionview


Andreas___

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/lrucker%40vmware.com

This email sent to lruc...@vmware.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: onSocketDidDisconnect in CocoaAsyncSocket

2011-04-28 Thread Michael Dautermann
> 
> I started to use CocoaAsyncSocket to establish TCP connections among iPads.
> 
> I got a problem. According to the references (
> http://code.google.com/p/cocoaasyncsocket/wiki/Reference_AsyncSocket),
> onSocketDidDisconnect would be invoked immediately if the connection is not
> already disconnected. I felt confused. What does "not already disconnected"
> mean? I think onSocketDidDisconnect should be called when a connection is
> disconnected. The description in the reference is wrong?
> 
> I implemented a server and a client using CocoaAsyncSocket. When closing the
> client disgracefully, I noticed that onSocketDidDisconnect was NOT called.
> Anything wrong with it?

Here are some questions that might help get some further context:

how are you closing the client "disgracefully"?  

did the companion [AsyncSocketDelegate onSocket: willDisconnectWithError:] 
method get called?  

did you properly set your delegate and define that your object (the one that 
holds your delegate methods) conforms to the delegate protocol in it's .h file?


___

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


Scroll view within scroll view blocks scrolling

2011-04-28 Thread Indragie Karunaratne
Despite the confusing title, I'm sure this is an issue that someone else has 
run into before. I have a parent scroll view that houses a bunch of subviews, 
including an NSTextView (and its own scroll view). The problem is that if I try 
to scroll vertically through the parent view, the text view's scroll view 
"blocks" my scrolling if I try to scroll while the cursor is within the text 
view. How can this be avoided?

Thanks,
Indragie___

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


[Solved] Re: Accessing NSWIndowController attribute from a subview in IB

2011-04-28 Thread Ben Golding

On 29/04/2011, at 00:17, Alexander Spohr wrote:

>> I have a document-based app which loads a couple of NSWindowController 
>> subclasses.  That's fine.  In one of the subclasses, I load a nib with a 
>> NSView subclass.  It wants to access one of the instance vars in the window 
>> controller subclass.  I thought "no worries, I should be able to hook up a 
>> connection in IB and it will be right".
> 
>> [...]
>> 
>> Am I doing this the wrong way or do I have some sort of misunderstanding 
>> about how this works?
> 
> Either or both.
> 
> The view itself should not know anything about its controller or the 
> controllers ivars. Wrong direction.
> You should make your WindowController set SundialView's sundial when it has 
> been loaded. Problem solved.

Yes, you're right.  I wanted to try to make IB do everything but it can't.  I 
(independently) did exactly as you suggested and it works fine.  Thanks.

Ben.

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Kyle Sluder
On Thu, Apr 28, 2011 at 4:12 PM, Indragie Karunaratne
 wrote:
> Despite the confusing title, I'm sure this is an issue that someone else has 
> run into before. I have a parent scroll view that houses a bunch of subviews, 
> including an NSTextView (and its own scroll view). The problem is that if I 
> try to scroll vertically through the parent view, the text view's scroll view 
> "blocks" my scrolling if I try to scroll while the cursor is within the text 
> view. How can this be avoided?

By not embedding scroll views inside other scroll views?

Is there a reason you want to do this? Can you not just resize the
contents of the outer scroll view to fit your NSTextView plus whatever
other content you want?

--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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Michael Dautermann

On Apr 28, 2011, at 7:12 PM, Indragie Karunaratne wrote:

> Despite the confusing title, I'm sure this is an issue that someone else has 
> run into before. I have a parent scroll view that houses a bunch of subviews, 
> including an NSTextView (and its own scroll view). The problem is that if I 
> try to scroll vertically through the parent view, the text view's scroll view 
> "blocks" my scrolling if I try to scroll while the cursor is within the text 
> view. How can this be avoided?
> 

Scroll views within scroll views seem like potentially VERY confusing UI's for 
end users.  I can't think of any major shipping apps that have scrolling 
NSTextViews contained within a parent NSScrollView. Wouldn't it be possible to 
try to simplify the user interface?

But if you insist on going this route, I believe one way of solving your 
problem would be to detect where the event is happening, and if it's happening 
in the sub-scrollview.. have the parent scrollview resign first responder so 
events can flow through to hit the sub-scrollview.  When the mouse exits the 
subscrollview, re-enable (or becomeFirstResponder) the parent scrollview.  I'm 
not certain that this is right solution or not, but at least this might help 
give you some good hints.





___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Quincey Morris
On Apr 28, 2011, at 16:37, Michael Dautermann wrote:

> Scroll views within scroll views seem like potentially VERY confusing UI's 
> for end users.  I can't think of any major shipping apps that have scrolling 
> NSTextViews contained within a parent NSScrollView.

Well, Safari.


___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Indragie Karunaratne
I have resized all my text views so that all the content is visible without 
vertical scrolling, and I have disabled the vertical scroller on its scroll 
view. I would remove it from the scroll view entirely and avoid this issue, but 
I still need the text view's scroll view to horizontally scroll text. Would I 
be able to subclass the text view's scroll view to pass scroll events to the 
parent scroll view?

On 2011-04-28, at 5:37 PM, Michael Dautermann wrote:

> 
> On Apr 28, 2011, at 7:12 PM, Indragie Karunaratne wrote:
> 
>> Despite the confusing title, I'm sure this is an issue that someone else has 
>> run into before. I have a parent scroll view that houses a bunch of 
>> subviews, including an NSTextView (and its own scroll view). The problem is 
>> that if I try to scroll vertically through the parent view, the text view's 
>> scroll view "blocks" my scrolling if I try to scroll while the cursor is 
>> within the text view. How can this be avoided?
>> 
> 
> Scroll views within scroll views seem like potentially VERY confusing UI's 
> for end users.  I can't think of any major shipping apps that have scrolling 
> NSTextViews contained within a parent NSScrollView. Wouldn't it be possible 
> to try to simplify the user interface?
> 
> But if you insist on going this route, I believe one way of solving your 
> problem would be to detect where the event is happening, and if it's 
> happening in the sub-scrollview.. have the parent scrollview resign first 
> responder so events can flow through to hit the sub-scrollview.  When the 
> mouse exits the subscrollview, re-enable (or becomeFirstResponder) the parent 
> scrollview.  I'm not certain that this is right solution or not, but at least 
> this might help give you some good hints.
> 
> 
> 
> 
> 

___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Michael Dautermann

On Apr 28, 2011, at 8:07 PM, Indragie Karunaratne wrote:

> I have resized all my text views so that all the content is visible without 
> vertical scrolling, and I have disabled the vertical scroller on its scroll 
> view. I would remove it from the scroll view entirely and avoid this issue, 
> but I still need the text view's scroll view to horizontally scroll text. 
> Would I be able to subclass the text view's scroll view to pass scroll events 
> to the parent scroll view?


It sounds like the only scrollview you have now is the scrollview that contains 
the text, yes?  Or do you still have one scrollview (the one that contains the 
text view) inside another?  

p.s. Quincey mentioned Safari.  Bleh. I should've thought of the browsers.  
Safari has to handle all kinds of completely fugly website layouts.


___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Indragie Karunaratne
I have one inside another. The parent scroll view contains a bunch of stuff 
(the text view being just one of the subviews). I would use the text view 
without its own scroll view if it weren't for the fact that I still need 
horizontal text scrolling.

On 2011-04-28, at 6:22 PM, Michael Dautermann wrote:

> 
> On Apr 28, 2011, at 8:07 PM, Indragie Karunaratne wrote:
> 
>> I have resized all my text views so that all the content is visible without 
>> vertical scrolling, and I have disabled the vertical scroller on its scroll 
>> view. I would remove it from the scroll view entirely and avoid this issue, 
>> but I still need the text view's scroll view to horizontally scroll text. 
>> Would I be able to subclass the text view's scroll view to pass scroll 
>> events to the parent scroll view?
> 
> 
> It sounds like the only scrollview you have now is the scrollview that 
> contains the text, yes?  Or do you still have one scrollview (the one that 
> contains the text view) inside another?  
> 
> p.s. Quincey mentioned Safari.  Bleh. I should've thought of the browsers.  
> Safari has to handle all kinds of completely fugly website layouts.
> 
> 

___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Kyle Sluder
On Thu, Apr 28, 2011 at 5:07 PM, Indragie Karunaratne
 wrote:
> I have resized all my text views so that all the content is visible without 
> vertical scrolling, and I have disabled the vertical scroller on its scroll 
> view. I would remove it from the scroll view entirely and avoid this issue, 
> but I still need the text view's scroll view to horizontally scroll text. 
> Would I be able to subclass the text view's scroll view to pass scroll events 
> to the parent scroll view?

Why not just let the outer scroll view also scroll horizontally?

--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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Indragie Karunaratne
I can resort to this if there is no other option, but I would prefer not to 
have to do that because extending the text view past the margins I have on the 
parent view wouldn't look that great. 

On 2011-04-28, at 6:53 PM, Kyle Sluder wrote:

> On Thu, Apr 28, 2011 at 5:07 PM, Indragie Karunaratne
>  wrote:
>> I have resized all my text views so that all the content is visible without 
>> vertical scrolling, and I have disabled the vertical scroller on its scroll 
>> view. I would remove it from the scroll view entirely and avoid this issue, 
>> but I still need the text view's scroll view to horizontally scroll text. 
>> Would I be able to subclass the text view's scroll view to pass scroll 
>> events to the parent scroll view?
> 
> Why not just let the outer scroll view also scroll horizontally?
> 
> --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


Compile Error Wierdness

2011-04-28 Thread koko
I have built an iOS Cocoa Touch Static library.  The source is C++.  Builds 
with no error or warnings.

NOw I add this library to a View based iOS project.

I add a C++ file defining a test C++ class.

IN the .cpp I include a header for access to library finctions ... and here is 
what is wied to me ...

I get errors in the files that compiled as the library.

I get the following on inline, class and  statements

error: expected '=', ',', ';', 'asm' or '__attribute__' before '&' token

So is there a setting I am unaware of that lets me use this library in an iOS 
app?


-koko

___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Indragie Karunaratne
Figured out a super easy solution for this. Override scrollWheel: in an 
NSScrollView subclass:

- (void)scrollWheel:(NSEvent *)theEvent
{
[super scrollWheel:theEvent];
[[self nextResponder] scrollWheel:theEvent];
}

Works great :-)

On 2011-04-28, at 6:53 PM, Kyle Sluder wrote:

> On Thu, Apr 28, 2011 at 5:07 PM, Indragie Karunaratne
>  wrote:
>> I have resized all my text views so that all the content is visible without 
>> vertical scrolling, and I have disabled the vertical scroller on its scroll 
>> view. I would remove it from the scroll view entirely and avoid this issue, 
>> but I still need the text view's scroll view to horizontally scroll text. 
>> Would I be able to subclass the text view's scroll view to pass scroll 
>> events to the parent scroll view?
> 
> Why not just let the outer scroll view also scroll horizontally?
> 
> --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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Andy Lee
On Apr 28, 2011, at 8:22 PM, Michael Dautermann wrote:
> p.s. Quincey mentioned Safari.  Bleh. I should've thought of the browsers.  
> Safari has to handle all kinds of completely fugly website layouts.

Also iTunes -- the Apps tab, for example. I suspect, like Safari, it's using a 
WebView. I wonder if they'd designed the iTunes UI differently if there were no 
WebKit.

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


Re: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 4/28/11 7:42 PM, Indragie Karunaratne wrote:
> Figured out a super easy solution for this. Override scrollWheel: in
> an NSScrollView subclass:
> 
> - (void)scrollWheel:(NSEvent *)theEvent { [super
> scrollWheel:theEvent]; [[self nextResponder] scrollWheel:theEvent]; 
> }
> 
> Works great :-)

Will this give the best behavior?  Without testing, I assume that this
always hands scrolling off to the superview (in your case).

However, when I view a page in, say, Safari that has a scrollable
textarea, I observe that:

1) If I start scrolling with my cursor in the textarea it scrolls the
textarea.

2) If I start scrolling outside the textarea and scroll through it, the
page continues to scroll instead of triggering scroll of the textarea.

3) If I pause scrolling with my cursor in the textarea, there is a
couple second period during which resuming scrolling will still scroll
the page.  After this "cooling off" period, scrolling is handled as in
case #1.

While such behavior might not be what you envision, it does seem to be
uniform across multiple browsers and therefore might be what a user
expects (if you choose to go this route).

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFNuirnaOlrz5+0JdURAu3OAJ0datgca59zgNUGiC+lbkM/bcPMOQCfWPvN
nCbhxZ3QkTRyx5+z5SrXWcM=
=RkVE
-END PGP 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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Indragie Karunaratne
Notice that in my code I'm making a call to super, so using the above code, 
scrolling inside the text view would scroll both the parent scroll view and the 
text view scroll view at the same time. In my case, 2) was the only important 
thing for me because my text views don't scroll vertically (only horizontally). 
You could make it behave like Safari by using an NSTimer to create the "cooling 
off" period, but this simple workaround was good enough for my needs :)

On 2011-04-28, at 9:05 PM, Conrad Shultz wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 4/28/11 7:42 PM, Indragie Karunaratne wrote:
>> Figured out a super easy solution for this. Override scrollWheel: in
>> an NSScrollView subclass:
>> 
>> - (void)scrollWheel:(NSEvent *)theEvent { [super
>> scrollWheel:theEvent]; [[self nextResponder] scrollWheel:theEvent]; 
>> }
>> 
>> Works great :-)
> 
> Will this give the best behavior?  Without testing, I assume that this
> always hands scrolling off to the superview (in your case).
> 
> However, when I view a page in, say, Safari that has a scrollable
> textarea, I observe that:
> 
> 1) If I start scrolling with my cursor in the textarea it scrolls the
> textarea.
> 
> 2) If I start scrolling outside the textarea and scroll through it, the
> page continues to scroll instead of triggering scroll of the textarea.
> 
> 3) If I pause scrolling with my cursor in the textarea, there is a
> couple second period during which resuming scrolling will still scroll
> the page.  After this "cooling off" period, scrolling is handled as in
> case #1.
> 
> While such behavior might not be what you envision, it does seem to be
> uniform across multiple browsers and therefore might be what a user
> expects (if you choose to go this route).
> 
> - -- 
> Conrad Shultz
> 
> Synthetiq Solutions
> www.synthetiqsolutions.com
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iD8DBQFNuirnaOlrz5+0JdURAu3OAJ0datgca59zgNUGiC+lbkM/bcPMOQCfWPvN
> nCbhxZ3QkTRyx5+z5SrXWcM=
> =RkVE
> -END PGP 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


cpp class keywotd

2011-04-28 Thread koko
I am refining my previous post.

What could cause the cpp class keyword to not be recognized when compiling an 
iOS app?


BMetaData.h:13 class BMetaData

/Volumes/_working/_working/_iOS/DisplayEmbroidery/../../LibBase/LibBase/BMetaData.h:13:0
 
/Volumes/_working/_working/_iOS/DisplayEmbroidery/../../LibBase/LibBase/BMetaData.h:13:
 

error: expected '=', ',', ';', 'asm' or '__attribute__' before 'BMetaData'



-koko

___

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: cpp class keywotd

2011-04-28 Thread koko
Well, apparently, compiling for iOS app versus iOS static lib treats the 
processing of the .pch diifferently.
Moving some things out of .pch in the app build which are in the .pch of the 
lib build solved my problem.
I would like to know more about this if anyone can shed some light.

-koko



On Apr 28, 2011, at 9:34 PM, koko wrote:

> I am refining my previous post.
> 
> What could cause the cpp class keyword to not be recognized when compiling an 
> iOS app?
> 
> 
> BMetaData.h:13 class BMetaData
> 
> /Volumes/_working/_working/_iOS/DisplayEmbroidery/../../LibBase/LibBase/BMetaData.h:13:0
>  
> /Volumes/_working/_working/_iOS/DisplayEmbroidery/../../LibBase/LibBase/BMetaData.h:13:
>  
> 
> error: expected '=', ',', ';', 'asm' or '__attribute__' before 'BMetaData'
> 
> 
> 
> -koko
> 
> ___
> 
> 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/koko%40highrolls.net
> 
> This email sent to k...@highrolls.net
> 

___

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: cpp class keywotd

2011-04-28 Thread Quincey Morris
On Apr 28, 2011, at 20:49, koko wrote:

> Well, apparently, compiling for iOS app versus iOS static lib treats the 
> processing of the .pch diifferently.
> Moving some things out of .pch in the app build which are in the .pch of the 
> lib build solved my problem.
> I would like to know more about this if anyone can shed some light.

a. Don't cross-post. It violates the list guidelines.

b. It's likely not an Xcode problem or a Cocoa problem.

c. It's highly likely that your problem is the rookie mistake of leaving out a 
semicolon (or some similar syntax error) at the end of the .h file included 
just *before* the .h file where the error is reported. In "moving some things 
out", you probably eliminated the problem by luck.


___

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: Scroll view within scroll view blocks scrolling

2011-04-28 Thread Andy Lee
By the way, this is has come up before:



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


Re: cpp class keywotd

2011-04-28 Thread B.J. Buchalter

On Apr 28, 2011, at 11:48 PM, koko wrote:

> Well, apparently, compiling for iOS app versus iOS static lib treats the 
> processing of the .pch diifferently.
> Moving some things out of .pch in the app build which are in the .pch of the 
> lib build solved my problem.
> I would like to know more about this if anyone can shed some light.

If you put it in the .pch, it will get compiled for each of the languages used 
in your project, including obj-c (which does not understand "class'). The lib 
probably does not have any .m files, whereas the app does.

That's my guess. You can put preprocessor conditionals around the C++ code so 
that it only gets precompiled for the languages that support C++. 

For example:

#ifdef __cplusplus 

// code that requires C++ or obj-c++

#endif 

Best regards,

B.J. Buchalter
Metric Halo 
http://www.mhlabs.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