Re: spaghetti code with core data and multiple views

2009-07-14 Thread Quincey Morris

On Jul 13, 2009, at 15:42, Christopher Campbell Jensen wrote:

At first I figured this was a nice way of designing things. Each  
separate view element/window has it's own controller, and thereby  
reducing the amount of different tasks that the MainWindowController  
needs to deal with.
I am now reconsidering, as the amount of communication that will now  
have to happen between these three views is causing me many  
headaches, as I am struggling to see how I can get this all tied  
together. What I am hoping for, is that there is a way that the  
different views can create subsets of the core data repository (as  
in the search followed by the user selecting his desired results)  
which will be held in the managedObjectContext (or similar) and can  
then later be accessed by the other views.
What I mean, is that one operation of narrowing down the set of data  
will be held so that a the next operation executed is now only  
executing on that narrowed set. This would mean that each of my  
views didn't need to communicate with each other, instead they would  
perform their "narrowing down" on the core data set, and then hand  
control back to the MainWindow, which would then use only that  
narrowed down set for the further activities.


If you have made it this far, congratulations! I know this is a  
mess, and I am sure there are plenty of you who are upset with me  
for going about this all wrong. I am sure a lot of people will  
disagree with the outlined workflow, and be able to suggest better  
ways, but I am for now primarily interested in solving this  
technical challenge, as this app will mostly be for personal use and  
it's main purpose is for it to be a learning experience for me.


This is also my first post to this community, so if I apologize if I  
have broken any written or unwritten rules. I hope someone will be  
willing to offer some advice, or partial solutions; and please let  
me know if parts require further explanation, or perhaps a diagram  
to clear things up.


In terms of the app delegate, window controllers and view controllers,  
it sounds like you've done things perfectly for your given user  
interface design.


In terms of the "narrowed down" set of data, you haven't quite thought  
your MVC design through.


What you have discovered is, for your application design, the desired  
data model is *not* the core data managed object context, but a  
smaller abstracted object graph.


Think of your data model as the narrowed down data, which is (as an  
implementation detail of the data model itself) backed by the core  
data managed object context. Your data model consists of (I'm  
simplifying, of course) three collections: the set of core data  
entities your user wants to choose metadata types for, the  
corresponding set of metadata values for each type (for populating  
your popups), and the set of data values for each metadata value.


It's not clear if these three collections will themselves need to be  
saved somewhere, for the next time the user runs your application. If  
so, you could save this information as another set of core data  
entities, ready for fetching the next time your application starts. If  
not, then these collections are just objects you keep in memory and  
throw away as soon as the movie is re-written.


Is that any help?


___

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: spaghetti code with core data and multiple views

2009-07-14 Thread Christopher Campbell Jensen


On 14 Jul 2009, at 09:11, cocoa-dev-requ...@lists.apple.com wrote:


In terms of the app delegate, window controllers and view controllers,
it sounds like you've done things perfectly for your given user
interface design.

In terms of the "narrowed down" set of data, you haven't quite thought
your MVC design through.

What you have discovered is, for your application design, the desired
data model is *not* the core data managed object context, but a
smaller abstracted object graph.

Think of your data model as the narrowed down data, which is (as an
implementation detail of the data model itself) backed by the core
data managed object context. Your data model consists of (I'm
simplifying, of course) three collections: the set of core data
entities your user wants to choose metadata types for, the
corresponding set of metadata values for each type (for populating
your popups), and the set of data values for each metadata value.

It's not clear if these three collections will themselves need to be
saved somewhere, for the next time the user runs your application. If
so, you could save this information as another set of core data
entities, ready for fetching the next time your application starts. If
not, then these collections are just objects you keep in memory and
throw away as soon as the movie is re-written.

Is that any help?


Thanks for the kind words :)

The three collections of data will not be saved for the next  
application run; the selections made will either be written to the  
file, or discarded when the application runs. This means that the  
persistent data will only be the original superset, ie. the "cached"  
data from the online sources. If the user makes all his selections,  
then quits the app without saving the data to the file, he will have  
to go through the same hoops (search, select from popups, fine-tune in  
textboxes) to get back to the same state as previously.


So what is needed is for me to be able to pass this "narrowed down  
data" from one view to another in a way so that the next view can make  
changes/further refinement before passing it on to the next one.


Now the question is, how do I do this? Will I have to either:
1. Create connections between the three sub-views by creating them  
all, then passing in pointers to the other two to each of them?
2. Each view passes the current "narrowed down data" back to the super- 
view (MainViewController), and have him pass it on to the relevant sub- 
views
3. Can this "narrowed down data" be somehow temporarily stored in core  
data so that each view only has to access the MOC and ask for the  
current "subset"?


I am sure it is becoming pretty clear that I really don't have my head  
wrapped around how core data functions, and it's abilities. My reasons  
for choosing to use core data, is it seemed the most sensible way to  
achieve easy lookup of data together with persistent storage. Plus  
it's one of the core frameworks, and makes sense to me to maximize my  
learning benefit by not avoiding them :)


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


What is the difference between the -awakeFromNib and -init?

2009-07-14 Thread Bright
In applications, there are - (void)awakeFromNib and  - (id)init method at the 
same time.




- (void)awakeFromNib{

//add code

   }




- (id)init{

self = [super init];

if (self) { 

   //add code

   }

return self;

}







What's the difference between the two methods?




Thank you.




Bright
___

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: What is the difference between the -awakeFromNib and -init?

2009-07-14 Thread Mike Abdullah
Have you read the documentation on them? I'm assuming not because  
Apple has included a lot of very helpful and detailed information on  
the two. If you have, perhaps you could tell us which point you're  
confused on? Otherwise, the best we can probably do is restate the  
documentation.


Mike.

On 14 Jul 2009, at 10:20, Bright wrote:

In applications, there are - (void)awakeFromNib and  - (id)init  
method at the same time.





- (void)awakeFromNib{

   //add code

  }




- (id)init{

   self = [super init];

   if (self) {

  //add code

  }

   return self;

}







What's the difference between the two methods?




Thank you.




Bright
___

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/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.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: Saving NSArray of custom objects

2009-07-14 Thread Mike Abdullah


On 14 Jul 2009, at 01:22, DKJ wrote:

I've defined my own MyClass and made it conform to the NSCoding  
protocol by adding methods like this:


- (void)encodeWithCoder:(NSCoder *)encoder
{
   [encoder encodeInt:index forKey:@"index"];
}

- (id)initWithCoder:(NSCoder *)decoder
{
  self = [super init];
  index = [decoder decodeIntForKey:@"index"];
  return self;
}


Slightly separate to the question, have you actually declared that  
your class conforms to the protocol, or just implemented the methods?  
i.e. the header should be something like:


MyClass : NSObject 
___

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: spaghetti code with core data and multiple views

2009-07-14 Thread Quincey Morris

On Jul 14, 2009, at 02:14, Christopher Campbell Jensen wrote:

So what is needed is for me to be able to pass this "narrowed down  
data" from one view to another in a way so that the next view can  
make changes/further refinement before passing it on to the next one.


Now the question is, how do I do this? Will I have to either:
1. Create connections between the three sub-views by creating them  
all, then passing in pointers to the other two to each of them?
2. Each view passes the current "narrowed down data" back to the  
super-view (MainViewController), and have him pass it on to the  
relevant sub-views
3. Can this "narrowed down data" be somehow temporarily stored in  
core data so that each view only has to access the MOC and ask for  
the current "subset"?


I am sure it is becoming pretty clear that I really don't have my  
head wrapped around how core data functions, and it's abilities. My  
reasons for choosing to use core data, is it seemed the most  
sensible way to achieve easy lookup of data together with persistent  
storage. Plus it's one of the core frameworks, and makes sense to me  
to maximize my learning benefit by not avoiding them :)


Nope, it's not a core data matter. Your difficulty is a conceptual one  
with the MVC design paradigm.


Your data model exists independently of the views. Typically, it is  
the responsibility of the controller to link the data model for any  
view that wants to use it, and there are two patterns for that:  
coordinating or mediating controllers.


The data model provide an interface (an API, if you will) to the  
"outside world" (the controllers and views). It's responsible for  
maintaining its own integrity, and it doesn't care who uses its "API".  
Thus, if the search view re-selects a different subset of core data  
entities (classes) for the other views to use, it tells the data  
model, which reconfigures itself. The change of state must then be  
propagated to all other API clients (i.e. views and/or controllers)  
that care. That mechanism is typically KVO (that is, the clients are  
registered to observe changes in specific data model properties) or  
notifications (the clients are registered to observe broadcasts from  
the data model).


You should be very familiar with the concepts in:


http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html

before proceeding. You *can* design applications without following  
that approach, but you'll miss out on what Cocoa gives you for free.


Also, you may want to try this without core data first. Starting with  
core data is very much jumping in at the deep end before you can swim.  
It's not even clear that core data is the correct technology -- you  
seem to really need an underlying database, not so much a  
sophisticated object-graph management system (though I may easily be  
wrong about that). Core data is *not* the former, but *is* the latter,  
with persistence.


I'm not trying to be discouraging. With enough smarts, you can come up  
with a solution by brute force. But if you want to use what Cocoa has  
to offer, it really is necessary first to know what Cocoa has to  
offer. :)



___

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


Getting the list of users and groups (anything new?)

2009-07-14 Thread Iceberg-Dev
On Leopard and later, is Directory Services still the official  
solution to retrieve the list of users and groups on the OS?


Starting with Leopard, we now have the Identity Service or  
Collaboration Framework but it apparently can't provide all the uid  
and gid on the system, only provide metadata for them.



___

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: Saving NSArray of custom objects

2009-07-14 Thread DKJ

On 14-Jul-09, at 2:51 , Mike Abdullah wrote:
Slightly separate to the question, have you actually declared that  
your class conforms to the protocol, or just implemented the  
methods? i.e. the header should be something like:


MyClass : NSObject 


Yes, I declared it as well. And NSKeyedArchiver is now doing exactly  
what I wanted to get done.


dkj
___

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: Best 'Cocoa' File Preview

2009-07-14 Thread Julien Jalon
Hi David,

Glad you got it to work.

On Tue, Jul 14, 2009 at 3:34 AM, David Blanton wrote:

>
> Furthermore why so convoluted and difficult? I should be able to say call
> me for files of type'.pes' and be done with it.


That's what you need to do. Except file extensions is not a "robust" way to
designate file types (what about mime types or other way to identify
types?). That's why MacOS X uses an intermediate abstraction for type naming
(the "content type")

- You have to declare the content type to the OS ("UTTypeIdentifier") and
how to "sniff" files of this type (file extension, mime type, HFS type and
whatever might come up in the future under "UTTypeTagSpecification"). You
can also declare other information as well (like its type description,
conformance, etc.)

- At this point the OS is able to identify your files, now you can associate
your file type to applications or plug-ins in "CFBundleDocumentTypes":

-- 
Julien
___

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: Cocoa Frontend to SDL App

2009-07-14 Thread Anthony Smith
Thanks for the information. It looks like I'll have to rewrite the  
video code to do what I need. Thanks a ton!


On Jul 12, 2009, at 2:25 PM, Alexander Spohr wrote:


Am 11.07.2009 um 22:09 schrieb Anthony Smith:

On Jul 11, 2009, at 11:51 AM, Alexander Spohr   
wrote:



Am 10.07.2009 um 21:35 schrieb Anthony Smith:

What I would like to do is be able to somehow make the binary of  
the SDL app use the Cocoa view as the output device and output  
all the video there or something similar.


Could you please clarify what you mean with "binary"?
A compiled executable?
For what system?




Yes, an OS X Intel compiled executable.


I’d thin this does not work.

atze

ps. what should that be good for anyway? If it is a working binary  
why would you try to push its screen output through a second app?




Sent from my iPhone


Sent from my Mac






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: What is the difference between the -awakeFromNib and -init?

2009-07-14 Thread Luke the Hiesterman


On Jul 14, 2009, at 2:20 AM, Bright wrote:


- (void)awakeFromNib{

- (id)init{

What's the difference between the two methods?


awakeFromNib is essentially a timing signifier. It gives your class a  
chance to do any first actions after being loaded from a nib much in  
the same way that applicationDidFinishLaunching gives your app an  
entry point for first actions. init is, of course, an initializer, and  
initialization code should go there. Generally speaking,  
initialization code should go into init or some variation for objects  
created in code. If you have an object that will be loaded from a nib  
and you need to perform extra initialization, do so in initWithCoder:.  
If you just want to know when your object is finished being loaded and  
initialized from a nib, use awakeFromNib. The documentation provides  
some rationale for awakeFromNib


"Suppose your nib file has two custom views that must be positioned  
relative to each other at runtime. Trying to position them at  
initialization time might fail because the other view might not yet be  
unarchived and initialized yet. However, you can position both of them  
in the nib file owner’s awakeFromNib method."


Moral of the story, use awakeFromNib for setup type stuff that can't/ 
shouldn't go into initWithCoder: for some reason.


Luke___

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: What is the difference between the -awakeFromNib and -init?

2009-07-14 Thread John Baldwin
Here's some reference material that I think helps explain this. It  
sounds like you're new to Cocoa, so a beginning Cocoa book might be  
helpful as well. I liked the Hillegass book, but shop around for one  
that fits your style.


awakeFromNib:
http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#/ 
/apple_ref/doc/uid/1051i-CH4-SW18


init:
Check the documentation for NSObject. It explains it pretty well.

John

On Tuesday Jul 14  2:20 AM, at 2:20 AM, Bright wrote:

In applications, there are - (void)awakeFromNib and  - (id)init  
method at the same time.





- (void)awakeFromNib{

  //add code

 }




- (id)init{

  self = [super init];

  if (self) {

 //add code

 }

  return self;

}







What's the difference between the two methods?




Thank you.




Bright
___


___

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: spaghetti code with core data and multiple views

2009-07-14 Thread Christopher Campbell Jensen
In addition to the previous post from Mr Quincey Morris, I received  
the following from Aaron:



Hi Chris,

I'm having troubles posting to the list so this is a private  
response, but feel free to use any of this email on-list if you want  
to.


I haven't read your entire email, but the impression I got from what  
I skimmed through sounds like you should at least make yourself  
familiar with the NSArrayController.  It has set of content objects  
(e.g., your objects managed by the managed object context) and  
allows you to apply a filter to "narrow down" the list of objects (I  
suggest you use the term "filtered", IMHO).  You can also supply  
sort descriptors to the array controller.  The result of filtering  
and sorting the content objects is the arranged objects.  The  
arranged objects could be read and acted on, or supplied as the  
content to another array controller, if needed.


So, to put it into context of a GUI, you could give an array  
controller a set of managed objects, connect a search field to the  
filter property, and connect an NSTableView to the arrangedObjects  
to show the result.  The table view can supply sort descriptors to  
the array controller.


If the array controller class isn't exactly what you need, it may at  
least give you some ideas on how to cleanly design what you need.   
For example, maybe you need more complex filtering, so you might  
have a utility window with text fields, check boxes, etc, that go  
into building an appropriate predicate to filter your objects.


BTW, I've read two of Quincy's replies, too, and I agree with his  
suggestions.  Also, I suggest playing with some examples or creating  
your own outside of your main project.  In the long run, it is much  
easier to try out concepts in isolation, and you will be less  
frustrated overall.


HTH,

Aaron


I wanted to thank both of you for putting thought and effort into  
providing me with valuable guidance and advice. You are both very  
right in that I am trying to cross the boundaries between the Model  
and the View, which would ruin all the hard work I have put into doing  
things "right". I will now take a step back and reevaluate my options.  
Step one will be to try and learn a bit more about core data, and I  
will be creating a few smaller, simpler apps to test things out. In  
addition I will be working through some tutorials to see if I can see  
any solutions to my issues.
If that does not pan out, then I will start looking at pure database  
based solutions.


Some initial investigation on that side brought me to:
http://code.google.com/p/entropydb/
The ability to store objective-c objects in an sqlite db might be just  
up my alley; or alternatively I can do it the good old fashion way and  
do all the work myself ;)


Additional comments or advice is always welcome!
___

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

2009-07-14 Thread Greg Guerin

Christopher J Kemsley wrote:


What I want:

A custom written server on Device A that listens on The Port for a  
device to connect. It expects to be sent an NSData object and will  
be expected to return another NSData object.


Device B should be able to, through a blocking method (or  
background in a thread), get an NSData object returned by Device A  
after giving it another NSData object. (for example, Device B asks  
Device A "Do I have messages?" and gets "Yes, you have two" in  
response)



BLIP might work:
  http://mooseyard.com/Jens/2008/05/blip-come-n-get-it/


I've tried setting up an HTTP server using NSSocketPort and  
NSFileHandle's "acceptConnectionInBackgroundAndNotify" method;  
however, I seem to be unable to get the client (regardless of  
platform) to be able to send an arbitrary data package to it and  
get one in return.



What do you mean by "arbitrary data package"?  You can't just send  
arbitrary binary data to an HTTP server and expect it to work.  You  
have to follow the HTTP protocol as defined in the relevant RFCs.



So, my question is, does anybody know of any other ways - or good  
beginner's guides - to networking in situations like this?



The situation you've described is essentially creating an entire  
custom network protocol.  Creating custom network protocols is not  
usually a task suitable for beginners.


  -- GG
___

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: Getting the list of users and groups (anything new?)

2009-07-14 Thread Kyle Sluder
On Tue, Jul 14, 2009 at 3:35 AM, Iceberg-Dev wrote:
> On Leopard and later, is Directory Services still the official solution to
> retrieve the list of users and groups on the OS?

On Leopard it is.  You know "and later" can't be discussed here.  Try
http://devforums.apple.com.

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


[MEET] Chicago CocoaHeads Tuesday July 14th

2009-07-14 Thread Bob Frank

Hi all,

Sorry for the late reminder.  I sent out the informal reminder last  
week, but forgot to send this out.


The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group is  
holding our next meeting Tonight July 14th, at 7:00 PM at the Apple  
Store on Michigan Ave. in the 2nd floor Theater.



 Agenda:
- WWDC Recap
- adjournment to O'Toole's

When:   
Tuesday, July 14th, 7:00 PM

Where:
Apple Store Michigan Avenue
679 North Michigan Ave. (at the corner of Huron & Michigan Ave.)
Chicago, IL 60611
http://tinyurl.com/Michigan-Ave-Apple-Store   (Google Maps URL)


- WWDC Recap

I'll be going over some to the key public developer  
announcements, and folks will be sharing their thoughts on the best &  
worst from WWDC




- O'Tooles

	We will continue our discussions at our local watering hold Timothy  
O'Toole's at 622 Fairbanks (2 blocks east of the store).




We also wish to thank the folks who run the theater space at the Apple  
store for letting us have our meetings there, and Jonathan 'Wolf'  
Rentzsch for helping out so often.  Thanks all.


Also, if you are working on a project and would like to talk about it   
briefly / promote it, I think it would be fun for people to hear  
about  other people's projects. Please email me off line and you can  
talk at  a future meeting or would like a book to review we would  
welcome that too.



July 27th 6:00 - 9:00: NSCoder Chicago Apple Store 4th floor

August 11th 7:00 - 8:00: CocoaHeads / CAWUG Apple Store 2nd floor

August 31st 6:00 - 9:00: NSCoder Chicago Apple Store 4th floor

September 8th 7:00 - 8:00: CocoaHeads / CAWUG Apple Store 2nd floor


CAWUG Resources

Mail list: http://groups.google.com/group/cawug
Google Site: http://groups.google.com/group/cawug
RSS feed: http://groups.google.com/group/cawug/feed/atom_v1_0_msgs.xml

 http://ical.mac.com/chicagobob/Chicago-CocoaHeads-CAWUG
 webcal://ical.mac.com/chicagobob/Chicago-CocoaHeads-CAWUG.ics


Cocoa Heads web site:
http://cocoaheads.org/us/ChicagoIllinois/index.html


Hope to see you at the meeting.

-Bob
___

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

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

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

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


Re: [iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?

2009-07-14 Thread Luke the Hiesterman

Comments inline.

On Jul 13, 2009, at 10:29 PM, James Lin wrote:


Hi all...

Continuing on with my network between 2 iPhone quest...

Thanks to Luke who made me aware of Game Kit and GKVoiceChat.

As I am new to network programming, I need you to help me make sense  
of the documentation.


If I am reading the GKVoiceChat documentation  
correctly...GKVoiceChat works in the following manner:


1. provide each client with an arbitrary participant ID and try to  
connect through GKVoiceChatService (is it a server/service provided  
by Apple?), and
the service will allow the 2 iPhones to discover each other and make  
connection?


When using voice chat, the connection is entirely handled by your  
code. The voice chat service simply handles the audio input and output  
and packetizing of the audio for transmission and receipt. The  
connection and sending is all your job.




2. Session can be created over Bonjour service. Can i create a  
"Session" object from the participantID that I provide for the two  
iPhones?


In this case, session does not refer to an object. Session is a  
generic term referring to whatever network setup your code has created.




3. There is a method called  
voiceChatService:sendData:toParticipantID: as part of the protocol.

The documentation says:
Implement the client’s voiceChatService:sendData:toParticipantID:  
method.
- (void)voiceChatService:(GKVoiceChatService *)voiceChatService  
sendData:(NSData

*)data toParticipantID:(NSString *)participantID
{
[session sendData: data toPeer:[NSArray arrayWithObject:  
participantID]

withDataMode: GKSendDataReliable error: nil];
}
The service calls the client when it needs to send data to other  
participants in the chat. Most commonly,
it does this to establish its own real-time connection with other  
participants. As both the GKSession
and GKVoiceChatService use an NSData object to hold their data,  
simply pass it on to the session.
If the same network is being used to transmit your own information,  
you may need to add an identifier

before the packet to differentiate your data from voice chat data.

Does this mean I can also send my own data over the internet through  
this service once a voicechat connection is made?'


This is not a data send service, as covered above. The networking code  
is entirely up to you. Once you've established your own connection  
code, you could easily tailor it to hand whatever data you want to  
send, but the voice chat API won't help with that.




4. Anyone know if sample code is available anywhere on the net for  
GKVoiceChat?


5. In the Game Kit Programming Guide documentation, it mentioned two  
methods

voiceChatService:sendData:toParticipantID:
voiceChatService:sendRealTimeData:toParticipantID:
However, these two methods are mysteriously missing from the  
GKVoiceChatService Class documentation.

Am I missing something?

If I am reading the documentation correctly: does this mean I can  
use the GKVoiceChatService that discovered each through

the service and SEND MY OWN DATA between the two iPhones?


No. These methods only inform you that packetized audio code is ready  
to be sent and asks you to send it on behalf of the voice chat  
service. As noted above, the sending is your business.



___

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


my app needs another incoming event after closing modal panel

2009-07-14 Thread Thomas Pesters
Hi,

I'm having the following problem:

- I'm opening a panel with a progress indicator
- I'm starting a new thread with a background function (via NSThread
detachNewThreadSelector)
- I do NSApp runModalForWindow: for the progress panel
- when the thread is finished, I close the progress panel ("orderOut:self")
and do [NSApp abortModal];

When my app finishes the background thread, the progress window closes as
expected, modal stops and the windows below get focus. But: only after an
event arrives (moving the mouse or hitting a key), the normal procedure of
the app continues (in my case an alert is supposed to open to show some
result of the just finished background processing, which does not open until
an event arrived).

What am I doing wrong?


greetings,

Thomas
___

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: my app needs another incoming event after closing modal panel

2009-07-14 Thread I. Savant

On Jul 14, 2009, at 8:33 AM, Thomas Pesters wrote:

...
When my app finishes the background thread, the progress window  
closes as expected, modal stops and the windows below get focus.  
But: only after an event arrives (moving the mouse or hitting a key)

...

  From what thread are you ending the modal session / closing the  
panel? If you're sending these messages from the worker thread, are  
you telling it to perform them on the main thread?


--
I.S.


___

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

2009-07-14 Thread Agha Khan

Hi:
How to create infoButton programaticlly? I do not have nib file, so I  
have to create inside - (void)loadView function.

Regards
-Agha
___

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

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

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

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


Core Data debugging

2009-07-14 Thread tmowlem
Hello,



I am writing a CoreData based application. I am creating Managed Objects and 
then saving them with by sending the save message to the context thus:




NSError *err;



BOOL result = [moc save: &err];




The problem is that every time I call this method the result is NO implying a 
failure when saving.

The data though appears in a table (which displays the data) and I see an XML 
file created with the data in it.




(I am using an XML based data repository during development. I am changing the 
data model sometimes but in these cases I am deleting the store file before 
starting the application so that a fresh XML file is created).




The issue for this post is that when I try to examine the NSError object it is 
invalid. The NSError is being created as the debugger shows an address for the 
object but its field are not set. Specifically the _code field had a variable 
value implying it was not specifically set, and the?_domain field was "Invalid".




I haven't been able to find another approach here. I looked at Instruments but 
the CoreData instruments seemed to look at data cache usage, etc, not really of 
help for my current problem. So:




How do I find out what the real issue is?

Is this lack of error reporting a bug/shortcoming of CoreData? Or of my code?

Are there other approaches to debugging here?







Thank you.




Tim Mowlem

___

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

2009-07-14 Thread I. Savant

On Jul 14, 2009, at 5:38 PM, Agha Khan wrote:

How to create infoButton programaticlly? I do not have nib file, so  
I have to create inside - (void)loadView function.


http://lmgtfy.com/?q=cocoa+creating+buttons+programmatically

--
I.S.


___

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

2009-07-14 Thread Joel Norvell

Hi Agha,

I guess you've overridden your NSViewController's loadView method, which seems 
like a good place to roll your own button.

You'll need to create and initialize the button with something like this:

NSButton *newButton = [[[NSButton alloc] initWithFrame:nestedFrame] 
autorelease];

And then you have to diddle with the button's instance variables.  

These might include – but are not limited to – things like:

[newButton setButtonType:NSSwitchButton];
[[newButton cell] setEnabled:YES];
[newButton setTransparent:NO];
[newButton setBordered:NO];
[newButton setBezelStyle:NSShadowlessSquareBezelStyle];
[newButton setTitle:@""];

There are enough permutations of these that you'll probably have to experiment 
some to determine which properties (instance method settings) are pertinent to 
your case.  (I've found that AppKido most useful for this.) 

If you want to hook the button into the responder chain, you'll need to do 
something like this:

[[newButton cell] setRefusesFirstResponder:NO]; // accept first responder.
[[newButton cell]  setShowsFirstResponder:YES]; // show   first responder.

And you'll need an action method, that IB would have let you connect 
graphically, but you'll set up like this:

[self setAction:@selector(buttonClicked:)];

If you're subclassing NSButton, the recipe is slightly more complicated.  But 
you're doing the same stuff, in the context of an NSButton subclass.

HTH,
Joel




___

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

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

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

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


Re: [iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?

2009-07-14 Thread Roland King



Sent from my iPhone

On 15-Jul-2009, at 2:47, Luke the Hiesterman  wrote:


Comments inline.

On Jul 13, 2009, at 10:29 PM, James Lin wrote:





When using voice chat, the connection is entirely handled by your  
code. The voice chat service simply handles the audio input and  
output and packetizing of the audio for transmission and receipt.  
The connection and sending is all your


That's not entirely true if I understand correctly. When a new voice  
chat is initiated the setup data is transmitted by your own code which  
is responsible for finding, connecting to and sending to the other  
device.


However once that setup is done, the audio sending is handled by the  
voice service code which sets up its own connection directly. Only if  
it's unable to do that (firewall etc) does it fall back to asking your  
client code to send each voice packet by calling the realtime method. 
 
___


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

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

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

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


Re: [iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?

2009-07-14 Thread Luke the Hiesterman


On Jul 14, 2009, at 3:59 PM, Roland King wrote:




Sent from my iPhone

On 15-Jul-2009, at 2:47, Luke the Hiesterman   
wrote:



Comments inline.

On Jul 13, 2009, at 10:29 PM, James Lin wrote:





When using voice chat, the connection is entirely handled by your  
code. The voice chat service simply handles the audio input and  
output and packetizing of the audio for transmission and receipt.  
The connection and sending is all your


That's not entirely true if I understand correctly. When a new voice  
chat is initiated the setup data is transmitted by your own code  
which is responsible for finding, connecting to and sending to the  
other device.


However once that setup is done, the audio sending is handled by the  
voice service code which sets up its own connection directly. Only  
if it's unable to do that (firewall etc) does it fall back to asking  
your client code to send each voice packet by calling the realtime  
method.


In either case, the hard work is in setting up the connection, which  
you have to do, and there's no support for arbitrary data.


Luke
___

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


{Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Frederick C. Lee
I'm trying to dearcive sqlite3-3.6.16-osx-x86.bin.

But what I get is: sqlite3-3.6.16-osx-x86.bin.cpgz

Is there a remedy?


Ric.
___

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

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

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

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


Re: [iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?

2009-07-14 Thread Roland King



Sent from my iPhone

On 15-Jul-2009, at 7:03, Luke the Hiesterman 
In either case, the hard work is in setting up the connection, which  
you have to do, and there's no support for arbitrary data.


Luke


Absolutely, this isn't the free and easy data channel the original  
poster wanted, finding the other device and sending that first  
connection request on behalf of the voice service is the hard piece. 
___


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: {Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread BJ Homer
It's not an archive; that's the actual binary executable.  Just rename it to
something more reasonable.
I dealt with this just last week.

-BJ

On Tue, Jul 14, 2009 at 5:06 PM, Frederick C. Lee wrote:

> I'm trying to dearcive sqlite3-3.6.16-osx-x86.bin.
>
> But what I get is: sqlite3-3.6.16-osx-x86.bin.cpgz
>
> Is there a remedy?
>
>
> Ric.
> ___
>
> 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/bjhomer%40gmail.com
>
> This email sent to bjho...@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


Re: How to create programaticlly

2009-07-14 Thread Joel Norvell

Hi Agha,

In my previous note, I forgot to mention that the button will have to be 
explicitly connected to its window's view hierarchy, unless your view 
controller does this for you.

So you'll probably need to find its super view and do something like this:

[itsSuperview addSubview: newButton];

And this may not be the only point I overlooked, which only reinforces the 
wisdom of I. Savant's admonition*.

My best,
Joel

*Give a man a fish and you feed him for a day. Teach a man to fish and you feed 
him for a lifetime. –Chinese Proverb




___

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: {Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Frederick C. Lee
I tried that.But I still have the problem.
Leopard wants to assign an application for it.

So the question, which 'binary executable'?

If I remove the .bin --- I get a text editor attempting to open it.

If I keep the .bin, by default, Leopard tries to dearchive it; which you
said, is not an archive.

Now what??



On Tue, Jul 14, 2009 at 4:13 PM, BJ Homer  wrote:

> It's not an archive; that's the actual binary executable.  Just rename it
> to something more reasonable.
> I dealt with this just last week.
>
> -BJ
>
> On Tue, Jul 14, 2009 at 5:06 PM, Frederick C. Lee 
> wrote:
>
>> I'm trying to dearcive sqlite3-3.6.16-osx-x86.bin.
>>
>> But what I get is: sqlite3-3.6.16-osx-x86.bin.cpgz
>>
>> Is there a remedy?
>>
>>
>> Ric.
>> ___
>>
>> 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/bjhomer%40gmail.com
>>
>> This email sent to bjho...@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


Re: {Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Kyle Sluder
On Tue, Jul 14, 2009 at 4:44 PM, Frederick C. Lee wrote:
> Now what??

Open up Terminal and run the program.  It's not a GUI app.

--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: {Cocoa semi-related} Unable to de-archive an archive from SQLite.

2009-07-14 Thread Frederick C. Lee
Ohh!
-rw-r--r--@ 1 Ric  Ric  514108 Jul 14 16:45 sqlite3-3.6.16-osx-x86.bin

[/Users/Ric/Downloads/tmp]chmod +x *.bin


[/Users/Ric/Downloads/tmp]ls -l
total 1008
-rwxr-xr-x@ 1 Ric  Ric  514108 Jul 14 16:45 sqlite3-3.6.16-osx-x86.bin*

[/Users/Ric/Downloads/tmp]./*.bin
SQLite version 3.6.16
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

---

Done.
Great!

Thanks!


On Tue, Jul 14, 2009 at 4:57 PM, Kyle Sluder  wrote:

> On Tue, Jul 14, 2009 at 4:44 PM, Frederick C. Lee
> wrote:
> > Now what??
>
> Open up Terminal and run the program.  It's not a GUI app.
>
> --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


Use Cocoa in QL Generator

2009-07-14 Thread David Blanton

I want to use Cocoa calls in my GenerateThumbnailForURL

what do I ahve to do to use Cocoa ?
___

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: Use Cocoa in QL Generator

2009-07-14 Thread Kiel Gillard

Read the documentation:

http://devworld.apple.com/documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Introduction/Introduction.html

The samples there use Cocoa as well as CoreFoundation.

On 15/07/2009, at 10:34 AM, David Blanton wrote:


I want to use Cocoa calls in my GenerateThumbnailForURL

what do I ahve to do to use Cocoa ?
___

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/kiel.gillard%40gmail.com

This email sent to kiel.gill...@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


Re: my app needs another incoming event after closing modal panel

2009-07-14 Thread Graham Cox


On 14/07/2009, at 10:33 PM, Thomas Pesters wrote:


Hi,

I'm having the following problem:

- I'm opening a panel with a progress indicator
- I'm starting a new thread with a background function (via NSThread
detachNewThreadSelector)
- I do NSApp runModalForWindow: for the progress panel
- when the thread is finished, I close the progress panel  
("orderOut:self")

and do [NSApp abortModal];

When my app finishes the background thread, the progress window  
closes as
expected, modal stops and the windows below get focus. But: only  
after an
event arrives (moving the mouse or hitting a key), the normal  
procedure of
the app continues (in my case an alert is supposed to open to show  
some
result of the just finished background processing, which does not  
open until

an event arrived).

What am I doing wrong?



When your thread updates the progress window, it needs to ensure that  
this happens on the main thread, so at some point the progress  
notifications need to call -performSelectorOnMainThread:, etc..


Also, may I ask: if you run the progress window modally, your app is  
effectively blocked, as far as the user's ability to get work done is  
concerned. This to my mind means that doing the work in a background  
thread is of no benefit - you may as well have run that code  
synchronously. In the few places I do this sort of thing, my progress  
window is modeless so that the user can do stuff while the background  
thread runs, and just keep an eye on how it's going with the progress  
window. Wouldn't that make more sense?


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


Why this program does not run without nib file?

2009-07-14 Thread Agha Khan

Hi:
you may download DigiClock http://appsamuck.com/day28.html

I just wanted to remove MainWindow.xib from the project.

so go to the info.plist and remove MainWindow.xib
go to the main.m and replace this line
int retVal = UIApplicationMain(argc, argv, nil,  
@"DigiClockAppDelegate");


go to DigiClockAppDelegate.m and add
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]  
bounds]];

rootViewController = [[RootViewController alloc] init];

last goto RootViewController.m and remove - (void)viewDidLoad we are  
not using NIB file

Add this line
- (void)loadView
{

	MainViewController *viewController = [[MainViewController alloc]  
initWithNibName:@"MainView" bundle:nil];

self.mainViewController = viewController;
[viewController release];
// we did not add infoButton
}
Run it The window will never show, but why? :-)
I have not remove any other Nib file.
Technically it should work.
What I am doing wrong?

Any help will be very much appreciated.


___

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: Why this program does not run without nib file?

2009-07-14 Thread Agha Khan

Got it.
No error in the code.
Just add one more line of code
self.view = viewController.view;

Thank everyone.

Best regards
Agha

On Jul 14, 2009, at 7:23 PM, Agha Khan wrote:


Hi:
you may download DigiClock http://appsamuck.com/day28.html

I just wanted to remove MainWindow.xib from the project.

so go to the info.plist and remove MainWindow.xib
go to the main.m and replace this line
int retVal = UIApplicationMain(argc, argv, nil,  
@"DigiClockAppDelegate");


go to DigiClockAppDelegate.m and add
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]  
bounds]];

rootViewController = [[RootViewController alloc] init];

last goto RootViewController.m and remove - (void)viewDidLoad we are  
not using NIB file

Add this line
- (void)loadView
{

	MainViewController *viewController = [[MainViewController alloc]  
initWithNibName:@"MainView" bundle:nil];

self.mainViewController = viewController;
[viewController release];
// we did not add infoButton
}
Run it The window will never show, but why? :-)
I have not remove any other Nib file.
Technically it should work.
What I am doing wrong?

Any help will be very much appreciated.


___

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/agha.khan%40me.com

This email sent to agha.k...@me.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: Core Data debugging

2009-07-14 Thread Fritz Anderson

On 14 Jul 2009, at 5:14 PM, tmow...@talktalk.net wrote:


BOOL result = [moc save: &err];

...
The problem is that every time I call this method the result is NO  
implying a failure when saving.

...
The issue for this post is that when I try to examine the NSError  
object it is invalid. The NSError is being created as the debugger  
shows an address for the object but its field are not set.  
Specifically the _code field had a variable value implying it was  
not specifically set, and the?_domain field was "Invalid".


Inspecting the instance variables of an NSError (or any other Cocoa  
object, for that matter) won't likely get you very far.


Using the debugger, step past the save:, then type "po err" at the  
debugger console. That will get you a human-readable summary of the  
error, but not enough detail. However, that summary will include the  
address of the NSError's userInfo dictionary. Say the address is  
0x123456; type "po (id)0x123456" into the console. You will be  
presented with a dump of the dictionary, from which you can (probably)  
glean the details of what went wrong.


(You might have a look into your mail client; it's inserting a  
distracting amount of extraneous white space.)


— F

--
Fritz Anderson -- Xcode 3 Unleashed: Now in its second printing -- 


___

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

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

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

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


GDB Running

2009-07-14 Thread Agha Khan

Hi:
How can we get rid of GDB Running message?
Best regards
-Agha
___

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: GDB Running

2009-07-14 Thread Kyle Sluder
On Tue, Jul 14, 2009 at 8:44 PM, Agha Khan wrote:
> How can we get rid of GDB Running message?

1) What are you talking about?
2) Shouldn't you be talking about it on the xcode-users list?

--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: NSSocketPort initRemoteWithTCPPort is never valid

2009-07-14 Thread Ken Thomases

On Jul 14, 2009, at 1:40 AM, Christopher J Kemsley wrote:

This is just a quick question for anyone who may know (or, at least  
I hope it's quick)



If I declare a port:

port = [ [NSSocketPort alloc] initRemoteWithTCPPort:portNumber  
host:hostName ] ;


And use it with an NSConnection, it works.

If I use that same port in any other way (such as NSFileHandle) it  
doesn't work. The error it gives is:


[NSConcreteFileHandle writeData:]: Bad file descriptor

(when I use   initWithFileDescriptor:port.socket  )


An NSSocketPort is intended for use with Distributed Objects and  
NSConnection or, at least, to communicate with another NSSocketPort at  
the other end.  You would use the NSPortMessage class for sending data  
in the latter case.


I don't think it's suitable for creating an arbitrary socket  
connection to a remote port.


The particular problem you're encountering is probably due to this  
sentence in the documentation of -initRemoteWithTCPPort:host:


"A connection is not opened to the remote host until data is sent."

It's quite possible that the socket file descriptor isn't even  
allocated until then, either.  Even if the file descriptor has been  
created, connect() hasn't been called at the point where you're trying  
to init your NSFileHandle object with it.  And since you're trying to  
use the file descriptor rather than the NSSocketPort object from that  
point on, there's no opportunity for NSSocketPort to establish the  
connection.  It can't very well hook into the system calls and  
magically connect the socket when something tries to write through the  
file descriptor.


In other words, what you're trying to do isn't a supported usage  
pattern.



Ideally, I'd like to be able to use NSFileHandle (or something very  
similar) on both ends of the connection.


Any thoughts/suggestions?


Look into using streams (NSStream and friends).  In particular, + 
[NSStream getStreamsToHost:port:inputStream:outputStream:].


http://developer.apple.com/documentation/Cocoa/Conceptual/Streams/

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