Re: NSDate without time portion

2010-01-05 Thread Karolis Ramanauskas
By formatting the dates as MMDD and keeping them in strings you can use simple string comparison to sort, compare and filter. They are also very easy to format for display purposes. If you want to go standard then use the ISO 8601 date format. It's -MM-DD. See

Re: NSDate without time portion

2010-01-05 Thread Karolis Ramanauskas
NSDate conceptually store time relative to Jan 1, 2001, GMT. When it is formatted for display, it uses the current time zone (or more correctly, the NSDateFormatter uses whatever time zone has been specified, or the current system time zone). If your time zone changes (such as by daylight

UITableView / iPhone Calendar List View Question

2009-12-17 Thread Karolis Ramanauskas
Dear developers, I do not have an iPhone, so I may be wrong since Calendar is not available on the simulator. UITableView needs to know the number of sections and rows for each section beforehand. However, Calendar allows repeating events that do not end, correct? If this is not correct, then my

Re: UITableView / iPhone Calendar List View Question

2009-12-17 Thread Karolis Ramanauskas
On Thu, Dec 17, 2009 at 9:05 PM, Luke the Hiesterman luket...@apple.comwrote: You can tell the tableView that you have a very large number of rows. tableView:cellForRowAtIndexPath: is only called when a cell will actually come into view, so even though you claim your table to be very large,

Re: UITableView / iPhone Calendar List View Question

2009-12-17 Thread Karolis Ramanauskas
On Thu, Dec 17, 2009 at 9:13 PM, Luke the Hiesterman luket...@apple.comwrote: Yes, eventually the calendar list view will come to an end. I'm able to hit that point easily by scrolling fast for several seconds on my phone. Luke Ah, I see! So it's all an illusion! ;) Thanks. Just to confirm,

Re: UITableView / iPhone Calendar List View Question

2009-12-17 Thread Karolis Ramanauskas
and there's no reason a user should ever get through that many rows. Luke On Dec 17, 2009, at 7:15 PM, Karolis Ramanauskas wrote: On Thu, Dec 17, 2009 at 9:13 PM, Luke the Hiesterman luket...@apple.comwrote: Yes, eventually the calendar list view will come to an end. I'm able to hit

Re: UITableView / iPhone Calendar List View Question

2009-12-17 Thread Karolis Ramanauskas
Luke helped me with this a little bit, but, after experimenting, it seams there is more to it. I guess there is still something I do not understand about this. Yes, I can set a huge number of rows. But I want them to be grouped into sections. However, UITableView wants to know exactly how many

Re: UITableView / iPhone Calendar List View Question

2009-12-17 Thread Karolis Ramanauskas
of sections but it isn't easy to calculate the size of said sections. What are you really trying to do? Luke Sent from my iPhone. On Dec 17, 2009, at 8:01 PM, Karolis Ramanauskas karol...@gmail.com wrote: Luke helped me with this a little bit, but, after experimenting, it seams there is more

Making NSFetchedResultsController register changes to the entity's relationship, not just attributes

2009-12-03 Thread Karolis Ramanauskas
Good day, I have an NSFetchedResultsController set up with an entity, ENTITY. ENTITY has a to-one relationship called REL. Now, in my table view, cells display some data that are the attributes of ENTITY and some data that are the attributes of REL. When I change the values of the attributes of

Making NSFetchedResultsController register changes to the entity's relationship, not just attributes

2009-12-03 Thread Karolis Ramanauskas
Good day, I have an NSFetchedResultsController set up with an entity, ENTITY. ENTITY has a to-one relationship called REL. Now, in my table view, cells display some data that are the attributes of ENTITY and some data that are the attributes of REL. When I change the values of the attributes of

Re: MacResearch Tutorial on beginning a Cocoa/iPhone app.

2009-12-03 Thread Karolis Ramanauskas
Agreed, no network connection no graph! ;) What if I need to update my graph live? On Thu, Dec 3, 2009 at 2:48 PM, Philip Vallone philip.vall...@verizon.netwrote: This post is very misleading. The tutorial is called Using VVI for Graphing on iPhone however there is no graphing. The graph is

Re: mySQL client lib linking problem...

2009-11-23 Thread Karolis Ramanauskas
Glad you found your solution... This is out of my league. Quite interesting though, so I will creep this exchange. Peace On Mon, Nov 23, 2009 at 1:32 AM, Michael Davey frak@gmail.com wrote: Well, it may not have been the most elegant of solutions, but it works... Basically I downloaded

Re: Build target question

2009-11-23 Thread Karolis Ramanauskas
Perhaps not quite what you need but I am working on code for iPhone and OSX in parallel and I am using one main.m, one Prefix.pch. I believe you will need several info.plist files because target specific stuff lives in them, this is easy though because you point to info.plist from the target info

Re: mySQL client lib linking problem...

2009-11-22 Thread Karolis Ramanauskas
I think your dylib file has been compiled under debug only. When you compile your app under release, the compiler complains that dylib is compiled under debug. Recompile your dylib under release then compile your app under release. Better yet you should add you dylib project (drag and drop) to

Re: mySQL client lib linking problem...

2009-11-22 Thread Karolis Ramanauskas
: The dylib is the one that comes from the OS X build of mySQL - I did not build it myself :o( On 23 Nov 2009, at 16:50, Karolis Ramanauskas wrote: I think your dylib file has been compiled under debug only. When you compile your app under release, the compiler complains that dylib is compiled

Re: mySQL client lib linking problem...

2009-11-22 Thread Karolis Ramanauskas
I guess you found the answer as I was typing my correction. Do you have the source to dylib you are using? On Sun, Nov 22, 2009 at 11:54 PM, Karolis Ramanauskas karol...@gmail.comwrote: I made a little mistake. It's not a debug/release issue, although that would give you similar problems

Re: How to change UITableView cell style dynamically

2009-11-21 Thread Karolis Ramanauskas
I don't see an example of how you are creating cells in your first post. But in case you were using the same string for the reuse identifier then when the cell is loaded the second time it will not switch to a different style. Because whatever cell was cashed the first time it will be reused.

Re: IBOutlets or property + binding

2009-11-20 Thread Karolis Ramanauskas
Let me see. The way I understand what you want to do is this: You have some controls in your window: c1, c2, c3, c4... You don't care to be notified when they change. Only thing you care about is to read their values when you click a button. I thing the best thing to do here is just create a

Re: IBOutlets or property + binding

2009-11-19 Thread Karolis Ramanauskas
Would you create IBOutlets or properties + binding in that case? You will need to give an example of exactly what you want to accomplish. What values do you need?, etc. Then, perhaps it will be easier to answer. Peace - Hide quoted text - On Thu, Nov 19, 2009 at 5:48 AM, Christian Ziegler

Re: IBOutlets or property + binding

2009-11-19 Thread Karolis Ramanauskas
Arghh... I was beaten to an answer! :) Slow typing... Yeah, with bindings you will get a two-way connection. If you change your property's value programmatically, the stepper will update also. Instead of target-action you could set up an iboutleted property, connect stepper to it and observe

Re: Synchronization Core Data

2009-11-16 Thread Karolis Ramanauskas
), they would automatically update each other. Talk about a pleasant user experience! As you can see they do not talk about actually implementing synchronization, so my original question stands. Any ideas are appreciated. Thanks On Sun, Nov 15, 2009 at 8:49 PM, Karolis Ramanauskas karol...@gmail.comwrote

Sync my iPhone app with the Desktop version

2009-11-15 Thread Karolis Ramanauskas
Good day, Does anyone here have pointers on how to implement syncing of my iphone application with the desktop version. I am interested in the way Things on iPhone does it, for example: http://bit.ly/OrLhi. They use wi-fi. The biggest problem I have digging up any information is that looking for

Synchronization Core Data

2009-11-15 Thread Karolis Ramanauskas
Good evening to everyone, I'm in a (extensive) planning stage of a project and an issue of synchronization is forcing itself on me, I asked a question this morning about a networking side of things, and I got some info from nice people here about MYNetwork:

Re: Synchronization Core Data

2009-11-15 Thread Karolis Ramanauskas
Ha! I just saw that book Amazon a few hours ago, but for some reason didn't bother looking through the contents. I assumed I need an iPhone book. Thanks! On Sun, Nov 15, 2009 at 11:54 PM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: Apple's API for Persisting Data on Mac OS X

Strange NSNumberFormatter behavior

2009-11-10 Thread Karolis Ramanauskas
Good evening, My question involves the code below: NSNumberFormatter * nf = [[[NSNumberFormatter alloc] init] autorelease]; [nf setNumberStyle:NSNumberFormatterSpellOutStyle]; NSLog(@'%@', [nf numberFromString:@one]); // - LINE A NSLog(@'%@', [nf numberFromString:@one two]); // - LINE B

Subtle differences in the implementation of the Foundation framework on iPhone and OSX

2009-11-06 Thread Karolis Ramanauskas
Hello there, Thought I'll share a little observation I just made, and that cost me about an hour to debug. This is in hope that, using my experience, you may check for similar bugs. Look at this piece of code: /// NSNumberFormatter * nf = [[[NSNumberFormatter alloc] init] autorelease]; [nf

Re: Very, Very Simple iPhone SDK Question

2009-11-06 Thread Karolis Ramanauskas
Hi, You need to use CG structs on iPhone. CGPoint, CGRect... Don't forget different make function naming conventions either: NSMakeRect - CGRectMake. Karolis, Cheers On Thu, Nov 5, 2009 at 4:56 AM, Patrick William Walker patrick.william.wal...@nb.sympatico.ca wrote: Why do I get an

Single Static Library for iPhone and Desktop applications

2009-10-28 Thread Karolis Ramanauskas
Good day, I'm trying to set up a single static library, I only need it to link against Foundation, for both iPhone and Desktop applications. I can easily configure one library for iPhone application only, same with desktop application. However when I try to make one static library work with both

Re: Single Static Library for iPhone and Desktop applications

2009-10-28 Thread Karolis Ramanauskas
...also I wanted to ask, in case this is not possible how do I avoid copying existing classes I have written for desktop and using them in iPhone? I can easily create two versions of static library and keep copying/pasting files between them, but it seems cumbersome. Thanks again

Multithreading NSBezierPath creation and stroking. Measuring performance

2009-10-27 Thread Karolis Ramanauskas
Good day, For the last few days I've been working on my own 2D Scatter Plot View all is going great and it looks nice: http://i729.photobucket.com/albums/ww297/karolisr/Screenshot2009-10-27at12636AM.png At this point I started optimizing drawing, so I implemented some cacheing, etc. and I see

Re: Multithreading NSBezierPath creation and stroking. Measuring performance

2009-10-27 Thread Karolis Ramanauskas
attached is the .m file with relevant code... KR2DScatterPlotViewPlot.m Description: Binary data ___ 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

Re: Multithreading NSBezierPath creation and stroking. Measuring performance

2009-10-27 Thread Karolis Ramanauskas
Just noticed I forgot to lock: [plotBitmaps addObject:bitmap]; ___ 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

Re: I don't understand this leak

2009-10-20 Thread Karolis Ramanauskas
This may be a false positive. I recently had a similar leak: Category: Malloc 4.50 KB Event Type: Malloc RefCt: 1 Address: 0x103108000 Size: 4608 Responsible Library: ImageIO Responsible Caller: du_block::set_max_bytes(int, bool) Ken Ferry on this list explained it was a false positive.

Re: NSSplitView and NSScrollView

2009-10-15 Thread Karolis Ramanauskas
Good day, Would you like to share some of your code? It would be a lot easier to see what may be going on... Cheers! On Thu, Oct 15, 2009 at 3:31 AM, Harry Sfougaris hsfouga...@mac.com wrote: I have placed a NSSplitView inside a NSScrollView in code. However, when the user resizes one of the

Malloc leak from ImageIO library

2009-10-15 Thread Karolis Ramanauskas
Good day, I was running my app with Instruments - Leaks. This is a document-based-application. Whenever I save or open a file I get this leak: Category: Malloc 4.50 KB Event Type: Malloc RefCt: 1 Address: 0x103108000 Size: 4608 Responsible Library: ImageIO Responsible Caller:

Re: Malloc leak from ImageIO library

2009-10-15 Thread Karolis Ramanauskas
Thank you On Thu, Oct 15, 2009 at 3:05 PM, Ken Ferry kenfe...@gmail.com wrote: Hi Karolis, That one's a false positive. The JPEG2000 library allocates memory at pointer p, but holds onto a pointer q and constant k such that q + k is p. Leaks cannot tell that the app can still get at the

Re: Appropriate dealloc and finalize actions

2009-10-13 Thread Karolis Ramanauskas
For example, if I were creating an application with documents that consisted of connected nodes, I’d have the document own (retain) the nodes and have the nodes just reference (assign) each other. Actually, that's what I do ;) Thanks ___ Cocoa-dev

Re: Appropriate dealloc and finalize actions

2009-10-12 Thread Karolis Ramanauskas
Thanks, Kai, Greg, Jens, It's generally a bad idea to have two objects each retain the other. It produces a reference loop, which means neither object can be deallocated without manually releasing each side of the relationship. As was stated in my original email these are all weak

Re: Appropriate dealloc and finalize actions

2009-10-12 Thread Karolis Ramanauskas
Thanks to everyone! Reading all this I realized that there is a little more to GC than I know... or should I say a lot more. at this point I'm unable to choose exactly what may be the best solution. I will have to read documentation and interpret that information through the prism of my

Appropriate dealloc and finalize actions

2009-10-11 Thread Karolis Ramanauskas
Good day, everyone, The situation is simple, I have two instances of the same class (MyClass). This class has a connection instance variable and a declared property for that variable: @property (readwrite, assign) MyClass * connection; So basically an object has a reference to another object of

Re: A question involving properties

2009-10-11 Thread Karolis Ramanauskas
OK, perhaps I am misunderstanding you, but if you are simply trying to set the label of the NSTextField you may wanna do this. You do not need to allocate NSTextField programmatically, it will be loaded automatically. @interface TestAppDelegate : NSObject NSApplicationDelegate { NSTextField *

Re: A question involving properties

2009-10-11 Thread Karolis Ramanauskas
wrote: On Oct 11, 2009, at 2:35 PM, Karolis Ramanauskas wrote: OK, perhaps I am misunderstanding you, but if you are simply trying to set the label of the NSTextField you may wanna do this. Well...what I was **really** trying to do was get my head around using properties/ivars correctly

Re: Appropriate dealloc and finalize actions

2009-10-11 Thread Karolis Ramanauskas
to the now deallocated object without doing what I did: - (void)dealloc { if (self.connection) { self.connection.connection = nil; } [super dealloc]; } Thanks On Sun, Oct 11, 2009 at 6:11 PM, Greg Guerin glgue...@amug.org wrote: Karolis Ramanauskas wrote: - (void)dealloc

Re: How to use MySql, which api is for that

2009-03-14 Thread Karolis Ramanauskas
I happily used ActiveRecord http://github.com/aptiva/activerecord/tree/master Look how nice it is to connect: NSDictionary * databaseConnectionInfo = [NSDictionary dictionaryWithObjectsAndKeys: @127.0.0.1, @host, @obama, @user, @supersecretpassword, @password, @databasename, @database,

MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
Good Day, I'm in a MVC-induced contradiction here. I've read the archives and found good answers to many of my questions, however it seems one thing kind of escaped from being answered. I have Core Data Document Based app. Core Data model contains entities that describe graph objects (nodes). Of

Re: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
Thanks Sean, Benjamin and I. Savant for your responses so far, You could use the various setMetadata: methods of NSPersistentStore and NSPersistentStoreCoordinator. I thought metadata was meant to make stores searchable with spotlight? Is this the correct usage? I claim ignorance here :) You

Re: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
STOP IT. That's right. Stop it. No no, just just stop it.* I needed that, ;) I can't come up with a better way either, I've been sitting and reading all this morning, my platonic MVC ideal a little diminished... Perhaps this could be one-to-many relationship so I could associate

Re: MVC, storing VIEW-specific information and core data

2009-03-09 Thread Karolis Ramanauskas
Most of my Core Data entities have a Data blob attribute which is actually and archived dictionary of extra data. Each user's per-document view configuration is stored under keys within each blob. The Data blobs start out nil which just defaults to something reasonable in each view. This

Q: Creating bindable properties editors for Core Data entities

2009-02-26 Thread Karolis Ramanauskas
Good day, First of all I would like to thank to everyone who helped me with my previous question, I'm passed NSManagedObjectContextObjectsDidChangeNotification ;) Here is the scenario, I've looked at the archives, but I am still confused of the correct plan of action: I have a custom view that

Re: Creating bindable properties editors for Core Data entities

2009-02-26 Thread Karolis Ramanauskas
Hello, thnaks for your help, Jon, So I have a lot of this working now, but I have a problem! I created a XIB with one window, several views. When a user clicks on the object in the main view this happens: - (void)showPropertiesWindowFor:(KRSimFlowElement *)flowElement {

Re: Cocoa Document-based Application Template

2009-02-26 Thread Karolis Ramanauskas
You have to set up how you will save your files first, this is not core data. You will have to, for example, create an array that will hold the objects that you will be archiving and unarchiving to. Then you will have to modify the dataOfType and readFromData methods: - (id)init { self =

Re: Strange NSManagedObjectContextObjectsDidChangeNotification behavior

2009-02-25 Thread Karolis Ramanauskas
Lesson: Don't change model data in a -draw method. I really can't think of any reason why you'd want to do this. -draw is for drawing. Yes, perhaps, but I have to change it, perhaps not in a draw method itself, but in another method that get's called before it. In my real program I have one,

Re: Strange NSManagedObjectContextObjectsDidChangeNotification behavior

2009-02-25 Thread Karolis Ramanauskas
Is locationY the model attribute which you have to change? If so, I suggest that this is not rightfully a model or managed object attribute. Obviously, it's more of a 'view' thing than a 'model' thing. Remove it from your data model. Make it a regular instance variable instead or, better

Strange NSManagedObjectContextObjectsDidChangeNotification behavior

2009-02-24 Thread Karolis Ramanauskas
Good day, everyone, I have a core data document based app. There are two windows for each document. One is the Inspector window with mostly NSTableViews representing objects and their relationships. Another window consists of a custom view which draws graphical representation of the objects. In

Re: Strange NSManagedObjectContextObjectsDidChangeNotification behavior

2009-02-24 Thread Karolis Ramanauskas
OK, I managed to replicate my problem in this example project: http://strangeinversion.com/weird.zip If you are interested download it, only 44KB. It contains two core data entities: BigBagOfFruit and Fruit. 1. Run the program 2. Add a bag 3. Now add some fruit in it ;) 4. Move your mouse around

Re: plug-in

2009-02-24 Thread Karolis Ramanauskas
if this is the file you are talking about, I had no problem downloading it. Here I uploaded it to my site: http://strangeinversion.com/Paper2002.dmg.sit If it's something else, let me know... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)