Why the “Use of undeclared type UITableView” happened in Swift?
I am new to
Swift. I created a second
swift file call
DeviceInfo.swift and add a
I also add a
But the error
Use of undeclared type 'UITableView' show after I connect the
command + left. The error show like the following.
1. Why the
Use of undeclared type 'UITableView' happened ? How to solve it ?
2. Show I connect the
Thanks in advance.
- Are keys stored in the iOS or iCloud Keychains visible to the user?
- With UIPanGestureRecognizer, is there a way to only act so often, like after x many pixels were panned?
- Creating an autolayout-based metrics view
- How to create padding(spacing) between rows in tablview
- ios: how to dismiss a modal view controller and then pop a pushed view controller
- Storyboard segues causing memory leaks
3 Solutions Collect From Internet About “Why the “Use of undeclared type UITableView” happened in Swift?”
click the point and drag to your tableView.
You need to add
import UIKit at the top of your file, in the area where you’ve already got
import Foundation. Without UIKit imported, your object doesn’t know what a UITableView is.
UITableView in in UIKit framework, you didn’t imported that. SO
self.tableView.dataSource = self; self.tableView.delegate = self;
In your .h file you can do:
@interface YourClassName : UIViewController<UITableViewDataSource,UITableViewDelegate>
And make sure you connected the tableView with an
- Updating XCODE using different apple account
- Fitting annotations on a MKMapView while keeping user position centered
- Search Bar Cancel Button don´t work in ios 7 sometimes
- How do you make a shake animation for a button using Swift 3
- iOS UIImagePickerController result image orientation after upload
- Xcode 6 resizes app automatically for iPhone 6 and 6 plus
- iOS create UILabels dynamically
- background: fixed no repeat not working on mobile
- Swift replace substring regex
- How to develop or migrate apps for iPhone 5 screen resolution?
- filtering NSArray into a new NSArray in objective-c
- How to know when iOS device is plugged in?
- Handling autorotation for one view controller in iOS7
- Picture post to Facebook ends up in the wrong place
- UIAlertController change font color