IOS 獲取當前Wifi的SSID
首先新增框架:SystemConfiguration.framework
然後引用 #import <SystemConfiguration/CaptiveNetwork.h>#pragma 獲取裝置當前連線的WIFI的SSID - (NSString *) getDeviceSSID { NSArray *ifs = (__bridge id)CNCopySupportedInterfaces(); id info = nil; for (NSString *ifnam in ifs) { info = (__bridge id)CNCopyCurrentNetworkInfo((__bridge CFStringRef)ifnam); if (info && [info count]) { break; } } NSDictionary *dctySSID = (NSDictionary *)info; NSString *ssid = [[dctySSID objectForKey:@"SSID"] lowercaseString]; return ssid; }
相關推薦
iOS 獲取當前頂層的ViewController
lec cte nil else sent iap sel top 獲取 iOS 獲取當前頂層的ViewController #pragma mark - topVC - (UIViewController *)theTopviewControler { UI
iOS 獲取當前正在顯示的ViewController
cells 當前 tro 顯示 log sar adding pro == //獲取當前屏幕顯示的viewcontroller - (UIViewController *)getCurrentVC { UIViewController *
iOS 獲取當前頁面控制器
在開發過程中,我們經常需要獲取當前 window, rootViewController, 以及當前 ViewController 的需求,來實現跳轉或者其他業務需求. 如果 .m 實現不是在當前視檢視情況下, 或者在子檢視中,我們需要快速的獲取到當前控制器,.
iOS獲取當前位置經緯度
最近在做一個公交車查詢的專案,需要定位到當前位置以便進行附近站點查詢,和大家分享一下怎樣獲取自己當前位置的經緯度 首先新增CoreLocation.framework庫: 引用標頭檔案並宣告CLLocationManagerDelegate代理: 接下來宣告要用到的變數:
iOS 獲取當前window
在iOS 開發過程中,我們對頁面進行操作的時候,經常會獲取當前控制器controller或者檢視view的window。下面給大家分享一個方法 /** 獲取當前的window,不一定是keywindow @return 當前window */ -(UIWindow*)mainWindo
iOS 獲取當前時間(戳)及差值
一、獲取時間 1.獲取當前時間 + (NSString *)getCurrentTime { NSDateFormatter *formatter = [[NSDateFormatt
iOS 獲取當前時間,並按照要求格式顯示
寫一個常用的獲取當前日期,時間的程式碼。並且能以規定的格式顯示出來 1 2 3 4 5 NSDate *currentDate = [NSDate date];//獲取當前時間,日期 N
iOS 獲取當前時間戳和時間
NSDate *senddate = [NSDatedate]; NSLog(@"date1時間戳 = %ld",time(NULL)); NSStrin
iOS獲取手機型號、iOS獲取當前app的名稱和版本號
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary); // app名稱 NSString *app_Name = [infoDi
IOS 獲取當前Wifi的SSID
首先新增框架:SystemConfiguration.framework 然後引用 #import <SystemConfiguration/CaptiveNetwork.h>#pragma 獲取裝置當前連線的WIFI的SSID - (NSString *) getDeviceSSID {
iOS 獲取當前app的名稱和版本號
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary); // a
IOS 獲取當前裝置IP地址
最近公司專案需要捕捉IOS裝置Ip,沒辦法,只能上網翻了翻相關資料。。以下就是捕捉IOS裝置IP的方法 #include <stdio.h> #include <stdlib.h> #include <string.h> #includ
iOS 獲取 當前裝置 可用記憶體 及當前 應用 所佔記憶體
// 獲取當前裝置可用記憶體及所佔記憶體的標頭檔案 #import <sys/sysctl.h> #import <mach/mach.h> // 獲取當前裝置可用記憶體(單位:MB) - (double)availableM
iOS獲取當前網頁的頁面元素
iOS-獲取當前網頁的 url 和 title 和 html .h檔案 @property (strong,nonatomic)UIWebView *webView; @property (strong,nonatomic)NSString *currentURL;
iOS獲取當前月份的上一個月份
+ (void)setupRequestMonth { NSDate *currentDate = [NSDate date]; NSDateFormatter *formatter
iOS獲取當前時間及前一天或後一天時間
NSDate * date = [NSDate date];//當前時間 NSDate *lastDay = [NSDate dateWithTimeInterval:-24*60*60 si
iOS 獲取當前螢幕顯示的viewcontroller
if (![[[self getCurrentVC] class] isEqual:[MineMessageViewController class]]) //獲取當前螢幕顯示的viewcontroller - (UIViewController *)getCurrentV
iOS-獲取當前時間的年、月、日、時、分、秒
01 //獲取當前時間 02 NSDate *now = [NSDate date]; 03 NSLog(@”now date is: %@”, now); 04 05 NSCalendar *calendar = [NSCalendar currentCalendar]; 06
iOS獲取當前app的裝置名稱和版本號等內容
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary); /
iOS 獲取當前日期是星期幾
在開發過程中,有時候需要查詢當前日期是星期幾。這個其實是分兩個步驟:第一步是獲取當前日期距離1970的時間,第二步是把這個時間轉換為星期幾。 -計算傳入的時間是星期幾 - (NSString *