Every repository with this icon (
Every repository with this icon (
| Description: | Three20 is an Objective-C library for iPhone developers edit |
-
Status bar does not show network activity indicator during TTURLRequest.
Comments
-
8 comments Created 17 days ago by tomjadamsappstorexUIViewAdditions.m contains private APIsfixavailablexWe have had an app rejected because of the following private API calls:
UITouch.locationInWindow
UITouch.phase
UITouch.previousLocationInWindow
UITouch.tapCount
UITouch.timestamp
UITouch.touchFlags
UITouch.view
UITouch.windowI have found them in UIViewAdditions.m.
Comments
Ditto. We're going to resubmit with the patches from: http://github.com/tupil/three20/
I have ifdef'd them out in our fork. Are there others that you know of?
Their fork includes fixes to remove calling -firstResponder on UIWindow. I'm not sure why they did that, but it is private API.
Yeah, saw that. Have just checked, that fork is very similar to ours: http://github.com/mogeneration/three20
I will probably roll that branch back into our fork.
I added some code to prevent the UITouch references from being compiled in release builds.
That's helpful but not the complete picture. There's a category on UITouch that contains the references to private fields we were most recently rejected for (above). Basically up to about line 93 of UIViewAdditions.m can no longer be used in apps submitted to the store. There's also the firstResponder fixes identified in the branch above (we don't need them so I've no idea if they work).
Yeah, I don't think this fix will cover our rejection. We weren't using any of the category methods on UITouch, so Apple is probably doing some sort of static analysis to detect SPI usage.
-
More a comment on the documentation than a real issue: I was following the directions for including three20 in my XCode project to the letter and I kept getting a build error: "error: Three20/
Three20.h: No such file or directory"The solution I found is that you have to add the relative path to "three20/src" to the Header Search Paths in both the project settings AND the target settings for the target you're building. Changing the instructions on the main page to reflect this might save people a lot of headaches...
Comments
Duly noted. This is likely caused by your active target not inheriting your project's settings. In general you should only need to add three20/src to your target's header search paths. I've amended the wiki to take into account the error you pointed out.
http://wiki.github.com/facebook/three20/adding-three20-to-your-projectWe'll also update the readme.md so hopefully nobody suffers anymore headaches :)
-
1 comment Created 25 days ago by searlsNSObjectAdditions may break KVC-compliance for all objectscrashxI don't have the error in front of me, but I've been bitten by this one recently.
NSObjectAdditions.h declares a property named URLValue. Some libraries (i.e. ObjectiveResource) will inspect a class for its properties and assume them all to be KVC-compliant, then at certain points at runtime, will call set* on all properties, including setURLValue:, which NSObjectAdditions.m neither synthesizes nor implements. This blows up and kills the thread.
The workaround I've been using is to simply implement a do-nothing setURLValue method in each model class that's going to be introspected in this way. It might even be worth adding to Three20 itself with a slightly less confusing basic implementation, like this:
- (void) setURLValue:(NSString*)urlValue { /* Best not to call this, it's just here to maintain KVC-compliance */ [[TTNavigator navigator].URLMap from:self toURL:urlValue]; }(In my case I actually kept the implementation empty, because I didn't want some arbitrary library updating my URLMap because it had picked it up during runtime introspection.)
Comments
From the Apple documentation:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_get_set/SAppsGetSet.html#//apple_ref/doc/uid/TP40002164-CH18-SW4For properties (attributes and to-one relationships), you implement <key> and, if the property is not read-only, set<Key>: accessors.
The current signature for URLValue is
@property(nonatomic,readonly) NSString* URLValueA getter is defined in the .m file and, judging by the official Apple docs, there doesn't need to be a setter.
It's possible some libraries ignore the readonly property. In those cases it's the fault of the library, not the property.
-
1 comment Created about 1 month ago by BrindavoineMemory Leak in TTViewControllerleakxThe is a memory Leak in TTViewController.m Line 183.
Change :
NSMutableDictionary* state = [[NSMutableDictionary alloc] init];
To :
NSMutableDictionary* state = [[[NSMutableDictionary alloc] init] autorelease];
Comments
-
2 comments Created about 1 month ago by rajatmohanty13 Errors in TTCatalog when i run it in iphone simulator 3.0???noreproxwhile i compile & run the sample code TTCatalog 13 error displayed.
1)/Users/joehewitt-three20-969d6f644f2f12faa18dab4a958f4e099a59383e/src/TTSearchlightLabel.m:141: error: expected ')' before 'UIAccessibilityTraits'2)/Users/joehewitt-three20-969d6f644f2f12faa18dab4a958f4e099a59383e/src/TTSearchlightLabel.m:142: error: 'UIAccessibilityTraitStaticText' undeclared (first use in this function)
3)/Users/joehewitt-three20-969d6f644f2f12faa18dab4a958f4e099a59383e/src/TTStyledTextLabel.m:94: error: 'acc' undeclared (first use in this function)
4)...........
......... ........ ...... 13).......
Comments
You are most certainly doing something wrong. It works fine if you follow the instructions and setup your header search paths properly.
No repro, check out
http://wiki.github.com/facebook/three20/adding-three20-to-your-project -
5 comments Created 2 months ago by DesiGuy421crashxTTLauncherView - Switching to editing mode when there's only one TTLauncherItemfixavailablexWhen there is only one TTLauncherItem in the launcherview, the application crashes when the user initiates editing mode by tapping & holding the item.
Comments
To add to this, if you delete the last item you get a crash as well. It appears to be an endless loop involving the calls to wobble: but I didn't look into it in detail yet.
OK. So the problem occurs when commitAnimations is called and there are no animations to commit. This can occur for 2 reasons:
- There is only one item and that item is the dragItem - The last item was deleted before _editing was set to NOFor the first reason:
In the wobble method, only call [UIView commitAnimations] if there is at least 1 button that is not the dragButton. If you do not call commitAnimations, then to keep the wobble happily in order call [self performSelector:@selector(wobble) withObject:nil afterDelay:0.1]. This will keep the wobble going as soon as there is no dragButton. I'll post the updated wobble method in the next comment.Fix for second reason:
Just before calling the delegate method launcherView:didRemoveItem: if there are no items left call [self endEditing](void)wobble { static BOOL wobblesLeft = NO;
if( _editing ) {
} }CGFloat rotation = (1.5 * M_PI) / 180.0; CGAffineTransform wobbleLeft = CGAffineTransformMakeRotation(rotation); CGAffineTransform wobbleRight = CGAffineTransformMakeRotation(-rotation); [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.07]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(wobble)]; NSInteger i = 0; NSInteger j = 0; for( NSArray* buttonPage in _buttons ) { for( TTLauncherButton* button in buttonPage ) { if( button != _dragButton ) { ++j; if( i % 2 ) button.transform = wobblesLeft ? wobbleRight : wobbleLeft; else button.transform = wobblesLeft ? wobbleLeft : wobbleRight; } ++i; } } // Only commit the animation if we have more than 1 item to animate!!! if( j >= 1 ) { [UIView commitAnimations]; wobblesLeft = !wobblesLeft; } else { [NSObject cancelPreviousPerformRequestsWithTarget:self]; [self performSelector:@selector(wobble) withObject:nil afterDelay:0.1]; }
DesiGuy421
Fri Oct 02 12:59:57 -0700 2009
| link
This fix works great. Thanks!
-
TTThumbsViewController setPhotoSource/setDataSource
2 comments Created 2 months ago by vlgradeffI am trying to reload the thumbs from inside as setting a new photoSource array .I succeeded to do it by custom methods but the thumbnails are being actualized only when they go outside of the screen and return back. Is there any global method I can use to refresh this 'screen cache'?
Comments
-
2 comments Created 3 months ago by tewhaMemory management problems in UIColorAdditionsleakxPer this documentation:
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmObjectOwnership.html#//apple_ref/doc/uid/20000043-SW2UIColorAddition's [UIColor copyWithAlpha:] should return an object that has a retain count of 1 since it begins with "copy." Since it uses [UIColor colorWithRed:green:blue:alpha:], it's already been autoreleased and has an effective retain count of 0.
At the same time, [UIColor addHue] should not retain its returned color, as its name does not start with copy or new. (Be careful: this is used by toolbarButtonColorWithTintColor.)
Comments
Note: [UIColor addHue] has been fixed. [UIColor copyWithAlpha] remains.
-
TTScrollView with zoom disabled no longer snaps to page boundaries on touch ended
2 comments Created 3 months ago by ehrenkretTo repeat add
_scrollView.zoomEnabled = NO;below line 23 in ScrollViewTestController.m so the code segment looks as follows._scrollView = [[TTScrollView alloc] initWithFrame:self.view.bounds]; _scrollView.dataSource = self; _scrollView.backgroundColor = [UIColor whiteColor]; _scrollView.zoomEnabled = NO; [self.view addSubview:_scrollView];After making this change, the scroll view demo no longer snaps to page boundaries.
It seems like the following change from SHA: 7cc9f75 is the likely cause:
- if (!stayPulled && (self.pinched || (touchCount == 0 && self.pulled))) { + if ((self.pinched || (touchCount == 0 && self.pulled)) && zoomEnabled) {Comments
-
1 comment Created 3 months ago by klazukacrashxInfinite loop when notifying model delegates of load start when the model is outdatedfixavailablexSee thread and solution:
http://groups.google.com/group/three20/browse_thread/thread/b01d3364087e2c8f#Comments
-
[Addition] Possibility to add headers to Request.
1 comment Created 3 months ago by mrevilmeCould it be possible to add methods for adding headers to TTURLRequest.
There is one or more forks out there for this but since i wouldnt want to fork off Three20 for this small addition.http://github.com/verveguy/three20/commit/6760c09784f62f0bede14868e3ad38573ac05199
//Emil
Comments
-
TTTableViewController does not implement setEditing:animated:
1 comment Created 3 months ago by klazukaTTTableViewController should respond to the setEditing:animated: message by telling its tableView to toggle editing mode (show delete icons, etc.). This is part of the functionality that UITableViewController automatically provides with respect to managing a table view, but since TTTableViewController is not a subclass of UITableViewController, it does not inherit this behavior.
For your convenience, here is a simple implementation.
- (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; [self.tableView setEditing:editing animated:animated]; }Comments
-
TTPhotoViewController nextAction is not triggering -[TTModel load:more:]
2 comments Created 3 months ago by klazukaWhen the user is in the full-screen photo view, if he is looking at the last photo in the loaded set, but there are more photos available in the photo source, when he taps the "next" arrow button, it advances to a placeholder loading screen but the image never loads.
I looked into it with the debugger and found that when nextAction is triggered, the photo source never receives the load:more: message, even though you would expect that it would receive such a message, specifically where "more"=YES.
You can easily recreate this bug in the "photo example" part of my TTRemoteExamples project.
Comments
-
TTThumbsViewController doesn't draw photos under title bar
6 comments Created 4 months ago by tewhaAs soon as a photo is fully under the (transparent) title bar, it is no longer drawn. This is obvious when scrolling with PhotoTest2Controller, or with PhotoTest1Controller after touching "Show All". I would prefer images continue to be drawn, but turning off translucency would also fix this.
Comments
I have never seen this happen and I can't reproduce it now. Are you using the latest code, and building on OS 3.0?
Unless you've updated it in the last hour, yes.
OS 3.0 on simulator. Will check it on the device right now.
yes, same on device. Can I email you three PNGs that show you what I'm talking about?
Sure, you can email me at joe@joehewitt.com
-
3 comments Created 4 months ago by ZoneMREmpty table views after memory warningnoreproxThis can be seen on the TTCatalog sample app, and in our own project.
Steps to reproduce:
1. Start TTCatalog in the simulator
2. Click any demo item to go to another view
3. Attempt to return to the main view - it will be empty.Is the above behaviour the result of the samples taking a shortcut and not dealing with the low memory event properly? How is this supposed to be worked around?
Comments
Sorry, a side effect of the recent re-factoring. I will fix this one very soon.
fjtdichosa
Thu Oct 29 00:46:12 -0700 2009
| link
I've checked out October 17, 2009 source code and I'm still seeing this problem. Any suggestions?
-
"Open in Safari" from WebView ineffective during loading of page.
1 comment Created 4 months ago by grinich -
TTTableImageItemCell not fully applying imageStyle of TTImageItem
1 comment Created 4 months ago by CagedIn TTImageItem you can set the imageStyle property. In TTTableImageItemCell this property is accessed and applied to the _iconView. There is one issue I spotted immediately. The block of code in TTTableImageItemCell where all this is setup is below.
TTImageStyle* style = [item.imageStyle firstStyleOfClass:[TTImageStyle class]]; if (style) { _iconView.contentMode = style.contentMode; _iconView.clipsToBounds = YES; _iconView.backgroundColor = [UIColor clearColor]; if (style.size.width) { iconWidth = style.size.width; } if (style.size.height) { iconWidth = style.size.height; } }When you're checking style.size.height there is a mistake where you're setting iconWidth again instead of iconHeight.
The bigger issue is that no more of the imageStyle is actually used. I tried setting breakpoints in TTImageView and for reasons unknown to me none of the draw routines are ever called so the style is never applied. It's possible I'm missing something here, but I don't immediately see what it is.
Comments
-
TTAppMap not parsing URLs correctly (like tt://menu/1 in sample app)
2 comments Created 4 months ago by patrickxbWith the TTAppMapDemo, the MenuController showMenu: method only gets nil as a parameter for all the tt://menu/1, tt://menu/2, etc. URLs.
I've noticed the same thing in my app.
The only way I've been able to get any information to the selector in the pattern is to use query URLs (like [appMap addURL:@"tt://order?waitress=(orderWithWaitress)" modal:[ContentController class] selector:@selector(orderWithWaitress:params:)];) and ignoring what is in the waitress parameter (it's always nil).
Comments
I believe the bug is that in addURL... [pattern setSelector:...] gets called before addPattern:forURL:. Thus there aren't any patterns when setSelector gets called. So doing the following seems to work:
- (void)addURL:(NSString*)URL controller:(Class)controller selector:(SEL)selector { TTURLPattern* pattern = [[TTURLPattern alloc] initWithType:TTLaunchTypeCreate]; pattern.controllerClass = controller; // XXX pc swapped next two lines [self addPattern:pattern forURL:URL]; pattern.selector = selector; [pattern release]; }That's working for me at least...
-
TTWebController backButton not working correctly?
1 comment Created 4 months ago by normanrosnerIn TTWebController in webViewDidFinishLoad: it should be
backButton.enabled = [webView canGoBack]; otherwise it's not working correctly after you click the first link.
Or am I wrong?Comments
-
repro:
modify the sample app PhotoTest1Controller.m so that:
[TTURLCache sharedCache].disableDiskCache = YES; [TTURLCache sharedCache].disableImageCache = YES; [TTURLRequestQueue mainQueue].maxContentLength = 0;This makes it so that we can easily repeatdly reproduce this bug without interference from the cache. also need to change the max content length so that we can download large files. and do a request for a large image like:
[[[MockPhoto alloc] initWithURL:@"http://www.fsf.org/blogs/community/5-reasons-to-avoid-iphone-3g/iphone3g-original.png" smallURL:@"http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg" size:CGSizeMake(320, 480) caption:@"These are the wood tiles that we had installed after the accident."] autorelease],So if everything works fine, you should see the funky pink iphone image. Now go back, and load the image again. This time quickly cancel the request by pressing back. If you do it correctly, you will get an instant crash in:
- (void)imageViewDidFailLoadWithError:(NSError*)error { if (self.url == [_photo urlForVersion:TTPhotoVersionLarge]) {the issue here is that photo has already been released (and indireclty been dealloc). This happened in TTPhtoView:dealloc
[photo release] Hence we are trying to derefrence freed memory, big problem.
I fixed this by simply making sure that after the release, I do:
_photo = nil;in general you should always nil out your member variables after you release them. I have a handy macro:
define SAFE_RELEASE(obj) do {\
[obj release];\ obj = nil;<br/> } while(0)
looking at all your deallocs, I strongly suggest you nil things out, especially because of the intensive use of delgates (mostly strong reference ones)
Comments
-
Category Additions NOT WORKING on 3.0 device!!!
3 comments Created 5 months ago by stevejf7Has anyone else experienced this problem?
Here are a couple examples. This one uses a method defined in UIColorAdditions.h
UIColor* highlight = [color multiplyHue:0 saturation:0 value:1.2];
This one uses a method defined in NSObjectAdditions.h
[queue performSelector:@selector(loader:didLoadResponse:data:) withObject:self withObject:response withObject:_responseData];
I don't see anyone else mentioning this issue, so perhaps there's something strange with my setup.
Please help if you know the answer to this one. -Steve
Comments
jonmarimba
Wed Jun 24 00:16:29 -0700 2009
| link
In Project Settings, go to "Other Linker Flags" under the "Linker" section, and add "-ObjC" and "-all_load" to the list of flags. <--- From instructions. In 3.- SDK the -all_load will cause the linker to bring in the categories.
-
Category Additions NOT WORKING on 3.0 device!!!
1 comment Created 5 months ago by stevejf7Has anyone else experienced this problem?
Here are a couple examples. This one uses a method defined in UIColorAdditions.h
UIColor* highlight = [color multiplyHue:0 saturation:0 value:1.2];
This one uses a method defined in NSObjectAdditions.h
[queue performSelector:@selector(loader:didLoadResponse:data:) withObject:self withObject:response withObject:_responseData];
There doesn't seem to be any issues on the simulator. I don't see anyone else mentioning this issue, so perhaps there's something strange with my setup.
Please help if you know the answer to this one.
-SteveComments
-
TTPhotoViewController calls setWantsFullScreenLayout method on itself but the method is nowhere defined in 2.1 SDK. Simple Category can fix this problem
@interface NSObject(TTFullScreenLayout)
-(void)setWantsFullScreenLayout:(BOOL)value;
@end
Comments
-
I am having problems when I try to use a TTStyledTextLabel inside a UITableViewCell designed with Interface Builder.
The problem is that when a cell is being reused the Cell dimensions are distorted and only one columns of characters appear.
I am using the iPhoneSDK 3.0 GM build on a 3.0 GM device.
screenshot of my table view before scrolling...
http://i44.tinypic.com/15gaygx.jpg
and after doing some scrolling...
Comments
-
I am having problems when I try to use a TTStyledTextLabel inside a UITableViewCell designed with Interface Builder.
The problem is that when a cell is being reused the Cell dimensions are distorted and only one columns of characters appear.
I am using the iPhoneSDK 3.0 GM build on a 3.0 GM device.
screenshot of my table view before scrolling...
http://i44.tinypic.com/15gaygx.jpg
and after doing some scrolling...
Comments
-
I downloaded the Thrre20 Library and tried the Sample Code, but I only get an error inside the Console.
The Code compiles fine, but direkt after the start the App stops with only this message inside the console:
Program received signal: “EXC_BAD_ACCESS”.Comments
-
Problem with UIColor additions on iPhone OS 3.0
1 comment Created 5 months ago by bigwillI'm using Three20 as a dependency in another project and I got the following exception when creating a TTButton from a style I define in my own style sheet. It looks like something is not working quite right with the UIColor additions you created on 3.0 devices. Other relevant bits of data:
1) Works fine on 3.0 simulator, but not 3.0 device
2) I'm using the 3.0 GM Seed firmware2009-06-09 20:52:13.531 MyApp[179:207] *** -[UICachedDeviceRGBColor saturation]: unrecognized selector sent to instance 0x269bd0
2009-06-09 20:52:13.637 MyApp[179:207] 0 CoreFoundation 0x302920a5 exceptionPreprocess + 52
2009-06-09 20:52:13.645 MyApp[179:207] 1 libobjc.A.dylib 0x300165a8 objc_exception_throw + 40
2009-06-09 20:52:13.654 MyApp[179:207] 2 CoreFoundation 0x30292f85 -[NSObject doesNotRecognizeSelector:] + 112
2009-06-09 20:52:13.664 MyApp[179:207] 3 CoreFoundation 0x3021806f forwarding_ + 470
2009-06-09 20:52:13.676 MyApp[179:207] 4 CoreFoundation 0x3020eda0 CF_forwarding_prep_0 + 48
2009-06-09 20:52:13.686 MyApp[179:207] 5 MyApp 0x0006b9b9 -[TTDefaultStyleSheet toolbarButtonColorWithTintColor:forState:<br/> ] + 184 2009-06-09 20:52:13.696 MyApp[179:207] 6 MyApp 0x0006ced3 -[TTDefaultStyleSheet toolbarButtonForState:shape:tintColor:fon<br/> t:] + 34
2009-06-09 20:52:13.706 MyApp[179:207] 7 MyApp 0x00036131 -[MyAppStyleSheet destructiveButtonStyle:] + 172
2009-06-09 20:52:13.715 MyApp[179:207] 8 CoreFoundation 0x3025af61 -[NSObject performSelector:withObject:] + 24
2009-06-09 20:52:13.738 MyApp[179:207] 9 MyApp 0x000565b3 -[TTStyleSheet styleWithSelector:forState:] + 126
2009-06-09 20:52:13.754 MyApp[179:207] 10 MyApp 0x0006a349 -[TTButton setStylesWithSelector:] + 48
2009-06-09 20:52:13.770 MyApp[179:207] 11 MyApp 0x0006aa1d +[TTButton buttonWithStyle:title:] + 104
Comments
-
TTThumbsViewController stutters while scrolling w/ local thumbs
3 comments Created 5 months ago by lhackettWhen thumbnail images are loaded off the local documents directory, scrolling is "choppy." As cells reappear on screen the re-drawing appears to stutter the scrolling.
The stutter is not nearly as pronounced on the catalog example. It feels like the loading method is written with the loading of remote images in mind. When the catalog example has cells off screen, the cells are re-drawn and then the thumb is filled in as its retrieved. The short time involved re-drawing of both the cell and the thumb seems to be the cause of the stutter with local images.
Comments
Yeah I feel the same way. What I did was made small .jpg images and had them load as my thumbnails. It really sped things up. Still not as nice as the photos.app, but much, much better in general.
You really have to use tiny images to get good performance in the thumbs view controller. Scrolling is pretty choppy even in Apples photos app if you have a lot of thumbnails in an album. The good news is, the iPhone 3GS has no such problem with scrolling lots of images.
After you'd tweeted about how smooth your Facebook beta was on the 3GS, specifically the tables that lagged, I figured it was due to the hardware limitations of the 3G. I've optimized the thumbs as best I can; I make them the same size as the thumb cell itself (75x75). Any smaller and they get pixilated because the view appears to want to fill the cell. But if they're larger you're just adding unnecessary load time because the thumb cell crops out part of the image. I think I've optimized it as best I can.
One thing I noticed was that the "chop" is more pronounced because the nav bar at the top of the thumb view is transparent, so you actually see the rows being hidden/made visible. Changing the nav bar to be solid and adjusting the table so the rows are being hidden/drawn outside of the users view helps lessen the perceived stuttering.
-
While Clang, the open source Objective-C static analyzer does happen to flag quite a few false positives, and it likely misses plenty of bugs, it does sometimes catch things you've forgotten about.
For instance, in NSStringAdditions:

It suggests renaming createSpotlightMask:origin:radius: in TTSearchlightLabel to match guidelines, e.g. newSpotlightMask:
Object allocated on line 64 is returned from a method whose name ('createSpotlightMask:origin:radius:') does not contain 'copy' or otherwise starts with 'new' or 'alloc'. This violates the naming convention rules given in the Memory Management Guide for Cocoa (object leaked)
In TTThumbsViewController:

It also reports two initializations that are never used again in TShape.
Here, because copyWithAlpha in UIColorAdditions begins with "copy", it expects a retain count of 1 for the returned object:

I'm not sure what's going on here (in TTURLRequestQueue), as I haven't studied NSError much at all yet myself. I imagine you're trying to override the error, which might make sense except if the error pointer is null, as Clang so kindly points out: (it also highlights line 329 separately)

Did I mention Clang's great at worst case scenario planning? (TTThumbsTableViewCell)

Anyway, that's it for Clang. You can download it at http://clang.llvm.org/StaticAnalysis.html and for anyone having trouble running it, make sure xcodebuild works at the command line - it doesn't use the active configuration the Build buttons use, but instead look carefully in Project Settings for a command line mode drop-down (I think).
Thanks for the great work, Joe, I really appreciate it, and hope I can contribute more at some point too. :-)
Louis St-Amour,
from Toronto, Canada.Comments
-
TTMessageController's setBody: results in an unscrollable Text Editor
3 comments Created 5 months ago by searlsSo I have a TTMessageController and I'm calling setBody: on it. The text is applied fine, but when it's a lot of text (say, 800px worth), this method gets called and results in a very tall text editor that's obscured beneath the keyboard and also not scrollable (it just jitters when I try to scroll on 2.2.1):
- (BOOL)textEditor:(TTTextEditor*)textEditor shouldResizeBy:(CGFloat)height
Going to start brainstorming how I'd patch this.
Comments
Just confirmed using TTCatalog that this issue only occurs when building to 2.2.1. If I build to 3.0b5, it scrolls fine.
Regression bug from the latest 3.0 fixes?
Might have something to do with the timing of when you call setBody.
Fixed in commit:
http://github.com/searls/three20/tree/f9429c15ea909008a7f7846ddd888c82f79cb02cJoe has fixed this in his master as well by differentiating between checking for OS version being linked at compile-time and OS version on the host device at runtime. (The former being the correct thing to check in this case).
-
Just noticed this checkin by fly1028 to fix memory leaks in TTPhotoViewController. Making an issue for it so it gets some review and testing.
http://github.com/fly1028/three20/commit/d49beca5a44a6f55c79b090db88aece6ed856056
Comments
-
The only trivial way I can think of to change the appearance of an anchor tag in styled text right now is to override linkText: in the stylesheet, but how should/can one have multiple link styles currently?
I'm currently using a span and trapping its touch events to treat it like a a link. Groups email: http://groups.google.com/group/three20/browse_thread/thread/54939515d2516857
Comments
Fixed it by adding a check for the class attribute in the styled text parser. Check my commit here: http://github.com/searls/three20/commit/bad53eadf11a8fac93f3f9a3f6c360256bcf870c
-
5 comments Created 5 months ago by patrickxbTTTabStrip does not scroll horizontally when it is in the header view of a tablebugxIf you create a tab strip:
_tabBar1 = [[TTTabStrip alloc] initWithFrame:CGRectMake(0, 0, 320, 41)]; _tabBar1.tabItems = [NSArray arrayWithObjects: [[[TTTabItem alloc] initWithTitle:@"Item 1"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 2"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 3"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 4"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 5"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 6"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 7"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 8"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 9"] autorelease], [[[TTTabItem alloc] initWithTitle:@"Item 10"] autorelease],and set a table's header view to be the tab strip:
self.tableView.tableHeaderView = _tabBar1;The TTTabStrip will display just fine and you can selected the (visible) tabs, but you can't scroll the strip from side to side. Works fine in a regular view...
Comments
If you want to put a TTTabStrip in a table view, you have to use a TTTableView. TTTabStrip uses a UIScrollView, and TTTableView overrides the scrolling events. TTTableView has special touch handling code to deal with this.
I am using a TTTableView. Do you mean that it can't be in the table header view?
The workaround that I have been using is to just put it in the main view and put the TTTableView underneath it. It doesn't scroll vertically with the table, but it does work...
Thanks...
I just looked at the code for TTTableView, and it is missing the touch handling code that I thought was there. That code seems not to have made it in the conversion from the old Facebook app to Three20 as I thought it did. I'll see if I can dig it up and put it back for you.
-
/Users/ash/Documents/three20/three20/src/TTTableField.m:309: error: property 'text' attempting to use ivar '_text' declared in super class of 'TTTextViewTableField'
arm-apple-darwin9-gcc-4.2.1: /Users/ash/Documents/three20/three20/src/build/Debug-iphoneos/libThree20.a: No such file or directory
i get these build errors when building for a 3.0 beta 5 device
also building for the 3.0 beta 5 simulator, the image display doesnt seem to work properly. the image no longer fills the screen, and leaves white space below the image. Once you click on the image, its not possible to get the navigation bar back into view
Comments
ashleyevans
Wed May 27 04:27:27 -0700 2009
| link
ive solved this issue:
arm-apple-darwin9-gcc-4.2.1: /Users/ash/Documents/three20/three20/src/build/Debug-iphoneos/libThree20.a: No such file or directory
but still getting the 1 build error, I am also receiving the error when building the TTCatalog Sample project
-
TTPhotoView underlaps the Navigation Bar in beta builds
1 comment Created 5 months ago by coreyfloydIf building Three20 under the current beta SDK, the underlaps the status bar and Navigation bar leaving whitespace at the bottom of the screen equivalent in height to the status bar plus the navigation bar height. The photo jumps around when the tool bar/navigation bar appears and reappears on screen.
Comments
-
Some applications do not need to register a custom, internal url scheme with the NavigationCenter. However, they may assume that Three20 knows to handle the HTTP scheme automatically by launching MobileSafari.
If they do not set the urlSchemes property, http links in TTStyledText will not load (the shouldLoadExternalURL: message will never fire, even if the delegate is hooked up and implements the method).
The workaround for such applications is to set urlSchemes to an empty array. For example:
TTNavigationCenter* nav = [TTNavigationCenter defaultCenter]; nav.mainViewController = myTabBarController; nav.delegate = self; nav.urlSchemes = [NSArray array];Comments
-
Crash in TTPhotoView:imageViewDidFailLoadWithError
6 comments Created 6 months ago by endicoWhen I load a TTPhotoViewController subclass in a UINavigation controller it spawns a photo search request and sits there for a few seconds with no photos while it waits for the request to complete. If I hit the back button right away before any of the images load, deallocating the TTPhotoViewController causes a crash in TTPhotoView:imageViewDidFailLoadWithError presumably because _photo doesn't exist yet.
The crash is at the line 199 of TTPhotoView.m
if (self.url == [_photo urlForVersion:TTPhotoVersionLarge]) {Looking up the value of photo, gdb says "struct objc_object* photo 0x25bb00 Invalid"
No idea what Invalid means here or how to test for it.
Comments
If TTPhotoViewController is deallocated before the image is done loading, then during the process of deallocating TTPhotoView's superclass the network request will fail and send a didFailLoadWithError message back to TTPhotoView and crash because _photo has already been released.
Checked in a patch
http://github.com/endico/three20/commit/cd0760324e9d623dadb4b1e1fbfefecfcc1591ae
Jeffrey903
Wed Jun 03 18:30:19 -0700 2009
| link
I believe I just got this same issue, however, I am using the latest code. Here is my stack trace:
Incident Identifier: B36BEFF4-B7A6-4EC7-ACF1-FBD27435043A
CrashReporter Key: 2a2af7a
Process: Flixster [3717]
Path: /var/mobile/Applications/DFD1FAD0-6974-4288-9A41-B7712345F3E7/Flixster.app/Flixster
Identifier: Flixster
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]Date/Time: 2009-06-03 18:00:14.897 -0700
OS Version: iPhone OS 2.2.1 (5H11)
Report Version: 103Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread: 0Thread 0 Crashed:
0 libobjc.A.dylib 0x300c8c18 objc_msgSend + 20
1 Flixster 0x0008cea4 -TTPhotoView imageViewDidFailLoadWithError:
2 Flixster 0x0008b168 -TTImageView requestDidCancelLoad:
3 Flixster 0x000adb2e -TTRequestLoader cancel:
4 Flixster 0x000af736 -TTURLRequestQueue cancelRequest:
5 Flixster 0x000a34ba -TTURLRequest cancel
6 Flixster 0x0008ac30 -TTImageView dealloc
7 Flixster 0x0008cb78 -TTPhotoView dealloc
8 CoreFoundation 0x302562c8 -[NSObject release] + 28
9 UIKit 0x30a77500 -[UIView(Hierarchy) removeFromSuperview] + 468
10 UIKit 0x30a6f114 -[UIView dealloc] + 180
11 Flixster 0x00092e56 -TTScrollView dealloc
12 CoreFoundation 0x302562c8 -[NSObject release] + 28
13 UIKit 0x30a77500 -[UIView(Hierarchy) removeFromSuperview] + 468
14 UIKit 0x30a6f114 -[UIView dealloc] + 180
15 CoreFoundation 0x302562c8 -[NSObject release] + 28
16 CoreFoundation 0x3023c326 CFRelease + 58
17 CoreFoundation 0x3024d0fe CFTypeCollectionRelease + 30
18 CoreFoundation 0x30254ba6 CFArrayReleaseValues + 250
19 CoreFoundation 0x30254a12 CFArrayDeallocate + 54
20 CoreFoundation 0x3023c466 _CFRelease + 170
21 CoreFoundation 0x3023c34a CFRelease + 94
22 Foundation 0x30670248 -[NSCFArray release] + 2
23 Foundation 0x30670028 NSPopAutoreleasePool + 540
24 Foundation 0x306945b4 NSFireDelayedPerform + 344
25 CoreFoundation 0x30269d88 CFRunLoopRunSpecific + 2642
26 CoreFoundation 0x30269320 CFRunLoopRunInMode + 44
27 GraphicsServices 0x31567e58 GSEventRunModal + 268
28 UIKit 0x30a4fa6c -[UIApplication _run] + 520
29 UIKit 0x30a591d0 UIApplicationMain + 1132
30 Flixster 0x00002096 main (main.m:13)
31 Flixster 0x0000202c start + 44Oops, i was mistaken. It doesn't look like he checked in the fix after all. I guess you'll have to apply my patch for now.
Is there a way to re-open this issue?
Joe says he did check in the fix, but for some reason the change isn't showing up when I clone a new copy of the master.
-
warning: no '-initWithDateFormat:allowNaturalLanguage:' method found
1 comment Created 6 months ago by endicoYesterday's checkin uses the method initWithDateFormat:allowNaturalLanguage, but iPhoneOS doesn't have this method, only MacOS X. This means that I can compile for the simulator with no problems but when I compile for the device I get a warning when linking NSDateAdditions.o
three20/src/NSDateAdditions.m: In function '+[NSDate(TTCategory) dateWithToday]':
three20/src/NSDateAdditions.m:10: warning: no '-initWithDateFormat:allowNaturalLanguage:' method found
Comments
-
TTURLRequestQueue fails to load certain flickr images
2 comments Created 6 months ago by endicoAfter using TTPhotoViewController to view a lot of Flickr images I've seen a significant number that won't load because of issues with content length. Instead, a grainy, enlarged thumbnail image is displayed along with a caption that says 'this photo is not available. The square thumbnail images always seem to load but sometimes there's a problem with flickr's medium images.
from system.log
Connecting to http://farm3.static.flickr.com/2353/3536799600_47580f0bdc.jpg
MAX CONTENT LENGTH EXCEEDED (225821) http://farm3.static.flickr.com/2353/3536799600_47580f0bdc.jpgHere's the code that generates the log message.
http://github.com/joehewitt/three20/blob/ccadfb1dac61a0d9eda31af8fe93e4a38f9c7375/src/TTURLRequestQueue.m#L169To test this, add the following code to viewDidLoad in PhotoTest1Controller.com in the TTCatalog test app.
[[[MockPhoto alloc] initWithURL:@"http://farm3.static.flickr.com/2353/3536799600_47580f0bdc.jpg" smallURL:@"http://farm3.static.flickr.com/2353/3536799600_47580f0bdc_s.jpg" size:CGSizeMake(500, 375) caption:@"heart of stone"] autorelease],
Comments
You need to set the maxContentLength property appropriately on TTURLRequestQueue. For instance, in your app delegate's applicationDidFinishLaunching: method, do this:
[[TTURLRequestQueue mainQueue] setMaxContentLength:300000]; -
[TTURLRequest generatePostBody] does not generate Rails compatible form requests
1 comment Created 6 months ago by daikiniThe generatePostBody method does not format the multipart/form-data request in a format that Rails can parse.
Rails is returning the error:
Status: 500 Internal Server Error
bad content bodyI've fixed this in my fork:
http://github.com/daikini/three20/commit/076c731086e7e3f23aa9a9c13c9b8435de31f4e0I've tested the fix against PHP, Rails and Merb and they all can parse the new format correctly.
Comments
-
TTMessageController (as modal view) is shortening height TTTableViewController
2 comments Created 6 months ago by searlsJust observed something while testing a message view. Say I have a table view layout (really long content) about 3000px tall, end-to-end.
Then I call up a modal message controller and send and dismiss the modal.
I observe two peculiar things back in my original view:
1. That 3000px table view appears fine until you get to the bottom, and then it's about 300px too short (meaning you can't scroll to see the last 2/3 of the screen. I'm pretty sure this length = the height of the message controller's editable fields.- Table states (i.e. "Loading..." have the opposite effect, as when i invoke one of those, it visually is pushed down from the top by roughly 300px.
Anything jump out at you? Otherwise I'll start looking at how the message controller is affecting the layout of the table view.
Comments
-
3 comments Created 6 months ago by ablmBug: TTImageView: Round corners not workingfeaturerequestxHi
If you apply, a shape style to a TTImageView it will not work properly:
TTImageView *iv = [[[TTImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)] autorelease];
iv.style = [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:10] next:nil];
iv.contentMode = UIViewContentModeScaleToFill;
iv.image = [UIImage imageNamed:@"iTunesArtwork.png"];
[self.view addSubview:iv];The image will appear as expected, but with no round corners. If I apply it, to a TTView, without a TTImageView in it, it works perfectly.
I've read the drawInRect method in TTView and I'm not seeing any mistake. It should work...
Anyone knows how to solve this?
Cya :)
Comments
I got stumped on this one myself, and then I noticed TTContentStyle. That seems to be the trick.
Try this style:
[TTSolidFillStyle styleWithColor:[UIColor whiteColor] next: [TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:10.0f] next: [TTContentStyle styleWithNext:nil]]];An easy solution to this issue would be to include this example in TTCatalog (maybe in ImageTest1Controller?). Right now there is no code in TTCatalog that uses TTContentStyle.
-
Linking error: symbols not found in TTImageLayer
1 comment Created 6 months ago by et44Sorry if this is inappropriate - I'm new here. Wondering if anyone else has encountered this? Pulled git clone today, Monday, 04/27/09, and added to an otherwise working project. Build for Simulator 3.0 Debug fails with error:
".objc_class_name_CALayer", referenced from: .objc_class_name_TTImageLayer in libThree20.a(TTImageView.o) symbol(s) not found
collect2: Id returned 1 exit statusReally awesome to make this library available. Thanks!
Comments
-
TTStyledTextFieldCell is no longer correctly padded
1 comment Created 6 months ago by elliotbThe following commit - http://github.com/elliotb/three20/commit/77bbe0078f519933866226bce8cb1068c038b5d1#diff-7
breaks the padding for TTStyledTextFieldCells, as their content is now rendered up to all the edges of the cell due to the removal of the line:_label.contentInset = UIEdgeInsetsMake(kVPadding, kHPadding, kVPadding, kHPadding);
This is the case for tables with the grouped style. The plain style seems unaffected in TTCatalog.
Comments
Yes, I did that on purpose, because for my uses I was specifying the padding within the styled text itself (using a style on the root element). I do realize that there are cases where you'd prefer it the way it was before... not sure what the best solution is just yet.
-
viewURL property in TTGlobal.h never synthesized...
1 comment Created 7 months ago by patrickxb -
1 comment Created 7 months ago by jbripleyTTActivityLabel is not centered when in landscape orientationbugxTTActivityLabel defaults the centered and centeredToScreen properties to YES and the instance is put in the center of the screen when in portrait orientation. When switching to landscape orientation the activity label is moved down and to the left.
Comments
-
Icon and Image Table Fields inconsistently resize
2 comments Created 7 months ago by arrakisI have a table with TTIconTableFields that load images from a web url. The images scale to approximately 175 pixels high, but initially the table does not account for this an simply makes each row the size necessary to display the included text. If you scroll around a bit, some of the cells will sometimes resize and get bigger to display the image properly, but usually the images just overlap into neighbooring cells. The problem is even worse with ImageTableFields, as those have inconsistent heights AND inconsistent image sizes (sometimes the images are shrunk to tiny icons, and sometimes they expand to bigger sizes).
Comments
jameshowison
Sun Jun 14 15:15:33 -0700 2009
| link
I'm seeing this as well. Perhaps there is some way to ensure that the TTImage being used to display those is set to have its View->Mode set to Aspect Fit (ok, so that's what one would do in IB).
Actually I'm seeing that they load in ok the first time (ie they fit themselves to the size of the cell), but after a bit of use (especially being selected) they revert to their full size and overlap the other cells.
This should be fixed with this commit: http://github.com/joehewitt/three20/commit/2e969465f6ba96c893507badaa50ba3ca5c25b2d#diff-7
-
TTTableViewController error field is larger than frame
1 comment Created 7 months ago by arrakisI have a subclass of TTTableViewController with a TTTabBar subview. Instead of making the tab bar the table header, I made it a separate view so it would not scroll with the table, and made the table's frame height smaller to accommodate this. However, now when it displays an error view, the error cell height is too large. It doesn't seem to be taking into account the height of the table view it is being displayed in.
Comments
-
-
The included ObjC categories are not getting linked when building for the device target (ie., arm) on the latest "beta" SDKs. Adding -all_load, in addition to -ObjC to OTHER_LDFLAGS seems to fix the problem. I have filed this: rdar://6806626
Comments
I'm seeing this behavior, but adding -all_load alongside -ObjC doesn't appear to be doing it for me. In particular, calling the UIToolbar catalog method itemWithTag: blows up:
*** -[MGToolbar itemWithTag:]: unrecognized selector sent to instance 0x220a70'
davidmorford
Fri May 29 15:22:44 -0700 2009
| link
Is -all_load and -ObjC specificed on the application target or the library target?
Both flags are added to all configurations for both my application project and the Three20 project. (and app works fine in Device 2.2.1 FWIW)
davidmorford
Fri May 29 16:43:12 -0700 2009
| link
Just did a clean and rebuild here with Beta 5 and the problem does not arise on the test device here. I only put -all_load on the application target (along with -ObjC and -l). I've not pulled any updates from joe's master for the past week or so however.
Is MGToolbar a class of your own? I think Apple put something about this, or a related issue, in the B5 release notes.
Thanks for following up. What exactly do you have in "-l[libraryName]", I only have "-all_load -ObjC".
I'll go check the release notes. Do you mind pulling latest from Joe?
(You're right, MGToolbar is just my own very thin UIToolbar extension)
davidmorford
Sat May 30 18:09:53 -0700 2009
| link
I synced up and all seems to work here. -lThree20 should be a part of the app project that is referencing the library. Xcode usually handles this when referencing another project. We can discuss in detail if you want over mail and post the result for everyone else back here. I saw your tweet for a split second but twitter seems to be having a meltdown.
davidmorford
Wed Jun 03 09:30:40 -0700 2009
| link
Closing as fixed. Thanks.
-
It would be useful if TTImageView could scale images in a similar way to UIImageView. Particularly if it had support for constraining/scaling the image to the view's size while keeping the aspect ratio of the image the same as the original.
Comments
-
This was posted on the google group a while ago, but I'm getting this bug as well:
As the poster said, you can reproduce it in TTCatalog by typing 'z'.
Comments
-
TTStyledText should support line breaks, and parse HTML tags that would result in line breaks.
Comments
richcollins
Mon Sep 21 14:14:45 -0700 2009
| link
The line breaks still aren't working properly for long links. The link is truncated (usually at the /), but space is still allocated for the wrapped portion of the link. If you touch down on the link, the wrapped area is highlighted, but there is no text in it.
CGRect screenBounds = [[UIScreen mainScreen] bounds]; [self setWindow:[[[UIWindow alloc] initWithFrame:screenBounds] autorelease]]; UIView *v = [UIView instantiate]; [v setFrame:[window frame]]; [v setBackgroundColor:[UIColor whiteColor]]; [window addSubview:v]; TTStyledTextLabel *label = [[[TTStyledTextLabel alloc] initWithFrame:CGRectZero] autorelease]; [label setBackgroundColor:[UIColor colorWithWhite:.9 alpha:1.0]]; [label setWidth:320]; [label setContentInset:UIEdgeInsetsMake(4, 4, 4, 4)]; NSString *xhtml = @"Long links get truncated: http://foo.com/ajdsajdhasjdhasjhsdhasdhasdlkahsdkhaslkdshdklashdkashdksah"; [label setText:[TTStyledText textFromXHTML:xhtml lineBreaks:YES URLs:YES]]; [label sizeToFit]; [v addSubview:label]; CGRect labelBounds = [label bounds]; [label setFrame:CGRectMake(0, screenBounds.size.height / 2 - labelBounds.size.height / 2, labelBounds.size.width, labelBounds.size.height)]; [window makeKeyAndVisible];
- appstore▾
- bug▾
- crash▾
- featurerequest▾
- fixavailable▾
- leak▾
- minor▾
- norepro▾
- Apply to Selection
-
Change Color…
Preview:preview
- Rename…
- Delete












It works fine for me with right out of the box.
Yep. This was a weird bug on my part. Thanks.
Solid.