uitableview not showing data - iphone

i followed the tutorial -> http://icodeblog.com/2008/09/02/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2/
but the thing is my uitableview isnt showing anything from database!! i did an nslog and able to query the data..so what could be the possible error?
i went through line by line with the source..but still can't find any problem..anyone tried the tutorial and face similiar problem as me?

Delegate and Datasources are connected?

I downloaded the sample code and it works with no problems under OS 3.0 and 3.1.2 and
http://icodeblog.com/wp-content/uploads/2008/09/todo-part-21.zip

Related

NSTableview reloadDataForRowIndexes sounds in mac

I am developing an app for Mac, I am getting a weird issue. When ever i reload a row and for a particular column when the reload code executes i am getting a sound output from my mac.
Below is the code
myTableView.reloadDataForRowIndexes(myTableView.selectedRowIndexes, columnIndexes: NSIndexSet.init(index: myTableView.columnWithIdentifier("source")))
I have a column with identifier "source", When ever i try to reload and after the execution of the above line i am getting sound in my mac.
I am using Xcode 7.3, OSX 10.11.6
Have you tried setting a breakpoint on NSBeep()? My gues would be that the table, or some other code trigger by the update is sending an error message.
Finally i found the issue. I debugged the code in depth and found the root cause.
Sound is coming when ever i am calling below code, here sourceTextField is a NSTextField. I commented this code and every thing is working fine.(i can directly give the value to text field like sourceTextField.stringValue.)
sourceTextField.insertText(itemText)
Thanks to all of you who made some time to write a comment/ post a message, Sorry for bothering you all guys.

XPC connection interrupted in Xcode 7 for iOS 9

I recently updated to Xcode 7 and upgraded my iPhone to iOS 9. I have developed and released an iOS app that had worked perfectly fine on the latest version of iOS 8 and Xcode 6.
Upon trying to go through the process of updated the app for iOS 9 support, I am getting the most ridiculously strange error that has left me baffled.
I have done all the syntax corrections automatically through Xcode, and now my app builds properly. It even runs fine at first.
I have a button that segues to a view controller with a WebView. This view controller loads a link that will display either an image, website, or video from youtube. The content is loaded perfectly fine as always. However, the program will crash and reboot the simulator (and my iPhone) and send me to the lock screen when I click the Back button (I am on a navigation stack).
In Xcode, I get the following messages:
XPC Connection Interrupted.
Terminating since there is no system app.
I have Flurry analytics integrated in my app by the way, not sure if thats an issue.
How can I fix this issue? My searches for XPC connections do not seem to return problems similar to mine. I do not even have a clue what an XPC connection is, so why is this in my app anyway?
EDIT: I have found a workaround for the issue. I cannot really say it is a fix.
The crashing was occurring during the use of the method self.navigationController?.popViewControllerAnimated, when set to true. I happened to set this to false, and the crashing stops (now the transition looks awful).
I do not know why this works, and just adds to my confusion.
The problem lied in the storyboard for me as well. I created a new project and laid out the views and everything seemed to be working fine. I found these couple lines in the storyboard source (right click on storyboard and select view as -> source code) which weren't common between the working version and the broken version:
<keyCommands>
<keyCommand/>
</keyCommands>
I have no idea what those lines are supposed to do, or how they crept into my storyboard file, but they were what was crashing the app so hard that the phone had to restart. I removed those lines from my main project and everything worked again.
This error can be caused by executing a loop repeatedly. In my case it was a 'for' loop in which I reset the counting variable. As soon as I added an NSLog in the loop it was obvious.
I just faced the same problem. I don't know if that will help you, but I also think it's coming from the Storyboard:
In my case, the problem is coming from a UITextView. Whenever I try to change the default text inside it, I have this error. If I let the default text or leave it empty, the app works fine. Making an IBOutlet and changing the text programmatically works as well.
I tried with other UI elements, but only the UITextView seems to have this issue.
I have struggled with exact same error. Through a process of elimination I established that it had nothing to do with the any class but had to do with the storyboard. Luckily I keep regular backup copies and I tried to compare storyboards to establish what I had done - but could find nothing obvious.
The backup copy worked fine and I was able to copy my controller classes (from the faulty copy with the changes) into the backup copy and they worked fine.
I think there is a bug possibly in storyboards.
I have same error message when I place a subview in -layoutSubviews method:
-(void)layoutSubviews
{
[super layoutSubviews];
[self populateByImageViews];
}
It causes infinite cycle of layout process and crashes app. Don't place subviews in this place!
Deleting UITextView from the one of the view in Storybord removes the error in my case.
In valueChanged: method of a UIControl, I had the same problem
so I made the code inside valueChanged: to run in main thread and it solved the problem.
#IBAction func valueChanged(sender: AnyObject) {
dispatch_async(dispatch_get_main_queue(), {
//code
}
}
For me was some missing constraints with a UISearchBar, but the error was only in the simulator.
I only add some constraints and works better
For me it was xcode live issues caused by IB_DESIGNABLE
If you have any IB_DESIGNABLE in source files, the system's live tracker will check for issues in StoryBoard too. It may leads to unnecessary building.
To disable it-
Open Storyboard file. Editor -> Automatically Refresh Views (Uncheck)
If you needs to Disable Live issue tracking
XCode -> Preferences -> General -> Issues -> Uncheck Live Issues
Reference
My issue probably originated with some storyboard issue, but I cleaned the project, restarted Xcode AND restarted the simulator app and that fixed it.
When using QLPreviewController, I am confronted with this problem. Error messages as follows,
XPC connection interrupted
_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)
Since XPC means OS X interprocess communication, so I think this can solve the problem, especial when updating the UI
dispatch_async(dispatch_get_main_queue(), ^{
// do what you want to do.
});
For Swift 4+, user
DispatchQueue.main.async {
//Your Code
}

MFMailComposeViewController.h Broken

After successfully implementing the MFMailComposeViewController in my app, run it in the simulator and my iPhone, where it still works fine, it just crashed.
I get 5 MFMailComposeViewController.h issues: Cannot find protocol declaration, Expected identifier or '(', etc,...
My Controller header includes:
MessageUI/MessageUI.h
MessageUI/MFMailComposeViewController.h
and conforms to protocol:
#interface DetallViewController : UIViewController < UIActionSheetDelegate,
MFMailComposeViewControllerDelegate>
I've tried to:
1) remove and add the framework
2) Restart the device and Xcode as suggested in many posts
3) Create a separate controller to handle MFMailComposeViewController
After 3 days with this issue I'm completely stuck on this. As you can imagine, any help would be appreciate.
I would think this is a kind of reference issue since it appears whether the framework is selected or not.
Thanks in advance
Just to anybody it may help, I finally found the issue:
A missing #end in an imported header.
Thanks to everybody for the efforts.

GridView in iPhone

I am working on an iPhone application in which I have to design a GridView, I have searched on google + stackoverflow and found that one possible solution is AQGridView, I have tried it but all of its examples are not working in XCode 4.1.
The error I am facing is: Expected ':', ",", ";", "}" or 'attribute' before '_dataSource'.
The line causing this error is id<AQGridViewDataSource> __unsafe_unretained _dataSource; (line no 100 in AQGridView.m).
What I am trying to achieve is to display buttons in 2x4 table.
Any Help will be appreciated.
Thanks
Edit
Ok, so I have downloaded Xcode 4.2 as some guys suggested in comments, now the previous errors are gone but I am having a new on __bridge Undeclared (first use in this function), the line causing this error is line no 961 in AQGridView.m (Source Code)
Thanks
First create a gridview objective class.write own delgate and datasource methods as tableview in it.call it in the viewcontrler class.
I think, on XCode 4.2 this is not an issue.
XCode 4.1 does not know __unsafe_unretained.
So just define it in some global project header:
#define __unsafe_unretained
and try to compile again.

UIAlertView subclass with text fields for iOS 4

Has anyone seen a solution for adding text fields to a UIAlertView (without private APIs)? On 3.x I've been using enormego's EGOTextFieldAlertView, but this doesn't work properly when compiled for iOS 4. Any suggestions?
http://github.com/enormego/EGOTextFieldAlertView/
I found a viable solution:
Use the ModalAlert from Erica Sadun's cookbook.
http://github.com/erica/iphone-3.0-cookbook-/tree/master/C10-Alerts/03-Soliciting%20Text/
The solution described here works great for me.
Jose Castillo found a fix for EGOTextFieldAlertView in iOS 4 and can be found here:
https://github.com/josecastillo/EGOTextFieldAlertView
It has a bit of a problem with auto-positioning the view, but there are several easy fixes, depending on your project needs.
I highly recommend this code as a start point.