UA-17470720-3

Jump to content


Photo
- - - - -

*HOT!* Sensible TableView v2.0 beta released!


  • Please log in to reply
96 replies to this topic

#61 Brendan Duddridge

Brendan Duddridge

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 170 posts
Reputation: 7
Good

Posted 15 December 2010 - 11:08 AM

Thanks Tarek,

Having the other delegate methods will help out tremendously.

I have switched the generation of the index titles to use:

[[UILocalizedIndexedCollation currentCollation] sectionIndexTitles]

This avoids the issue I was having. Unfortunately at the moment I don't have enough time to investigate the other issue further.

Thanks,

Brendan

#62 Geoffrey Alexander

Geoffrey Alexander

    Sr. Member

  • STV 2.0
  • PipPipPip
  • 42 posts
Reputation: 0
Neutral

Posted 15 December 2010 - 12:32 PM

If I could make just a general comment, I have found that in every release so far it is the development of STV's very powerful and complete delegate mechanisms that is the most appealing thing about it. Aside from all the other awesomeness of this release (which I'll dive into soon as I go forward with my next project and its particulars) it's the ability to balance STV's auto-magic features with the ability to dip in and easily tweak it to perfection in our own projects that makes it such a great tool. That having said, the more delegate methods you can give us, the better. Carry on!

#63 Brendan Duddridge

Brendan Duddridge

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 170 posts
Reputation: 7
Good

Posted 15 December 2010 - 01:23 PM

I agree. And the other nice thing about STV is we have the source, which enabled me to add this method:
-(BOOL) searchBarShouldBeginEditing:(UISearchBar *)searchBar {
	if([self.delegate conformsToProtocol:@protocol(SCTableViewModelDelegate)]
	   && [self.delegate respondsToSelector:@selector(tableViewModelSearchBarShouldBeginEditing:)])
	{
		[self.delegate tableViewModelSearchBarShouldBeginEditing:self];
	}
}

And I could do that right now while I wait for it to be added to the baseline code.

Thanks!

Brendan

#64 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 15 December 2010 - 05:22 PM

Thanks Geoffrey and Brendan for all the complements :) The completeness of STV's delegate system owes its presence to the great feedback we're continuously receiving from our customers. We just listen to you guys :)

#65 Tommy Wild

Tommy Wild

    Advanced Member

  • STV 3.0 Pro
  • PipPipPipPipPip
  • 175 posts
Reputation: 12
Good

Posted 19 December 2010 - 06:06 AM

I found a bug that has been making me lose my hair :D


When I create my view that uses STV and push it like the code below, customCellForRowAtIndexPath isn't always being called - only when you scroll. And even then it doesn't seem to behave correctly (cell height being one). I will email a project to you.

SelectionView *sv = [[SelectionView alloc] initWithNibName:@"SelectionView" bundle:nil];
	[self presentModalViewController:sv animated:YES];
	[sv release];


#66 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 21 December 2010 - 09:13 AM

Hi Tommy,

Thanks a lot for pointing this out! :)

It turns out that the problem is that, in STV's internal architecture, customCellForRowAtIndexPath is being called before the detailViewWillAppearForRowAtIndexPath method gets called. This happens because STV internally calls detailViewWillAppearForRowAtIndexPath as late as possible (after the detail table view has been created), as this is required to allow users to do certain customizations to the detail view controller.

The problem with this scenario is that you usually set the dataSource/delegate of your detail view model inside detailViewWillAppearForRowAtIndexPath. Thus, when STV checks if the detail view dataSource implements customCellForRowAtIndexPath, it always returns nil at first (since as we discussed, this check happens before detailViewWillAppearForRowAtIndexPath gets called). Now after the detail view has appeared and its dataSource has been set, this check now returns TRUE, and customCellForRowAtIndexPath finally gets called.

Fortunately our solution to all this is quite simple: we'll create a new SCTableViewModelDelegate method called detailModelCreatedForRowAtIndexPath, which will get called as soon as the detailModel has been created, and will give you the chance to set the dataSource property, as well as many other detail model customizations. detailViewWillAppearForRowAtIndexPath will still exist of course, and should be mostly used for detail view controller customization purposes.

Please tell me if you have any comments or suggestions. Thanks again Tommy! :)

#67 Tommy Wild

Tommy Wild

    Advanced Member

  • STV 3.0 Pro
  • PipPipPipPipPip
  • 175 posts
Reputation: 12
Good

Posted 26 December 2010 - 04:38 PM

Sorry for the late reply, as I've been out of town.

That sounds good Tarek. Please send me the beta version with this fix when you have it ready.

#68 Panamind

Panamind

    Experienced Member

  • STV 3.0 Pro
  • PipPipPipPip
  • 77 posts
Reputation: 1
Good

Posted 27 December 2010 - 11:11 PM

In SCTableViewModel line:585 reads:


	if(scSection.headerView && height<scSection.headerView.frame.size.height)
		height = scSection.headerView.frame.size.height;



I have a headerView that is only 2 px high (a shadowed line) but the returned minimum defaults to 22. I'm thinking if you have a custom headerView shouldn't the height become the height of the custom view?

So I changed it to:


	if(scSection.headerView)
		height = scSection.headerView.frame.size.height;
	

Gary

#69 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 28 December 2010 - 07:58 AM

Hi Gary,

You're right, we will modify this in our next release.

Thanks a lot! :)

#70 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 28 December 2010 - 10:22 AM

icyplains: Please send me the beta version with this fix when you have it ready.


Sure Tommy, expect something in the next couple of days. We're also about a week away from releasing the official STV 2.0 release.

#71 Tommy Wild

Tommy Wild

    Advanced Member

  • STV 3.0 Pro
  • PipPipPipPipPip
  • 175 posts
Reputation: 12
Good

Posted 28 December 2010 - 06:31 PM

I found another potential bug. I'm not sure if there is some property that I'm supposed to set to prevent this or not, but I couldn't find one.

I am working on putting in landscape support in my app and came across this. I have a view controller that has an STV-driven uitableview. The table has an SCTextFieldCell and an SCNumericTextFieldCell. While in portrait orientation, everything works as expected. However, when I turn the simulator to landscape and tap a cell to enter text, the table shoots up out of view.

I reproduced this problem with a simple project that I will email to you.

#72 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 29 December 2010 - 05:30 AM

Hi Tommy,

We really appreciate you taking the time and effort to replicate the problem, it has helped us tremendously. Thank you very much! :)

We expect to release our third (and final) beta late today or later on tomorrow, and it should address both of your issues. I'll send you as soon as we have it ready.

Thanks again Tommy.

#73 Tommy Wild

Tommy Wild

    Advanced Member

  • STV 3.0 Pro
  • PipPipPipPipPip
  • 175 posts
Reputation: 12
Good

Posted 29 December 2010 - 02:43 PM

Everything is working great so far, Tarek!

I have a question -

If I don't have a custom cell for a certain row, what do I return in customCellForRowAtIndexPath so that it will use whatever had been previously defined (automatically)?

#74 Tommy Wild

Tommy Wild

    Advanced Member

  • STV 3.0 Pro
  • PipPipPipPipPip
  • 175 posts
Reputation: 12
Good

Posted 29 December 2010 - 03:05 PM

Edit - IGNORE this, I got confused :P

[strike]Also one more thing-

In the SC_CustomCellProblem project I sent you, I am trying to use a custom cell for the main tableview (after tapping the "tap me" button).

customCellForRowAtIndexPath is never called. It does, however, work for the detailView (which the new beta fixed).[/strike]

#75 Panamind

Panamind

    Experienced Member

  • STV 3.0 Pro
  • PipPipPipPip
  • 77 posts
Reputation: 1
Good

Posted 29 December 2010 - 03:18 PM

Hi Tarek,

I placed a button on a TableViewCell within a XIB, made the TableViewCell's class SCControlCell, made the File's Owner my view controller and them tied the button action to a IBAction in the view controller. When I click the button it tries to call the action on +SCHelper rather than my view controller tied the the File's Owner of the XIB.

Any ideas?

#76 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 29 December 2010 - 04:09 PM

icyplains: If I don't have a custom cell for a certain row, what do I return in customCellForRowAtIndexPath so that it will use whatever had been previously defined (automatically)?


In the final STV release, you will be able to just return nil (I am assuming you're using an SCArrayOfObjectsSection here). Currently, we're solving a cell reuse technical issue that's preventing an SCArrayOfObjectsSection from having different types of cells for each object.

#77 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 29 December 2010 - 04:27 PM

panamind: I placed a button on a TableViewCell within a XIB, made the TableViewCell's class SCControlCell, made the File's Owner my view controller and them tied the button action to a IBAction in the view controller. When I click the button it tries to call the action on +SCHelper rather than my view controller tied the the File's Owner of the XIB.


Please note that STV only expects a cell object (and only one cell object) out of your XIB file, and setting the File's Owner is completely inapplicable here. You have at least two ways to correctly implement what you want:

1. Give the button a unique tag, then after loading the cell, load the button using the cell's controlWithTag method. Once you have a reference to the button, you can start to programmatically add actions to it.

2. Subclass SCControlCell, place an IBOutlet property in the new subclass, and connect it to the button in Interface Builder (after setting the cell's type to your new subclass). After the cell is loaded, you can use the button outlet to programmatically add actions to it.

Choosing which method to use is really a matter of taste, but method no.2 can sometimes be easier to manage if you have a lot of controls on the cell, which is not recommended anyways. Please tell me if you need further help with this.

#78 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 05 January 2011 - 01:38 PM

Hi Gary,

Just making sure that you've been able to successfully resolve your UIButton issues.

#79 Panamind

Panamind

    Experienced Member

  • STV 3.0 Pro
  • PipPipPipPip
  • 77 posts
Reputation: 1
Good

Posted 05 January 2011 - 04:34 PM

Hi Tarek,

Yes, I did resolve my UIButton issue by following your advice.

Gary

#80 Seth Vanderdrift

Seth Vanderdrift

    Advanced Member

  • STV 5.0 Pro
  • PipPipPipPipPip
  • 108 posts
Reputation: 20
Excellent

Posted 05 January 2011 - 07:39 PM

Not sure if this is the correct place.

Using the beta 2 (is there a place in your source files that show the 'version'?)

I've recreated the program from the CoreData Integration video.

It works, except:

When I create a task and save it, it shows up on the first tableview as it should.
If I tap on the row, it opens the detail view as it should

BUT the 'back' button no longer appears. You can't exit the detail view.

I'm not sure if I missed something in the tutorial or if it's a beta bug.

Thanks
Seth




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users